Files
ha-ninlight/tests_unit/test_manifest.py
T

27 lines
990 B
Python

"""The manifest must agree with the constants the code relies on."""
from __future__ import annotations
import json
from pathlib import Path
from custom_components.ninlight.const import DOMAIN
MANIFEST = Path(__file__).parents[1] / "custom_components" / "ninlight" / "manifest.json"
def test_manifest_matches_constants() -> None:
manifest = json.loads(MANIFEST.read_text(encoding="utf-8"))
assert manifest["domain"] == DOMAIN
assert manifest["zeroconf"] == [{"type": "_ninlight._tcp.local."}]
assert manifest["iot_class"] == "local_polling"
assert manifest["config_flow"] is True
assert manifest["requirements"] == []
assert manifest["dependencies"] == ["http"]
def test_manifest_points_to_gitea() -> None:
manifest = json.loads(MANIFEST.read_text(encoding="utf-8"))
assert manifest["documentation"] == "https://gitea.zukunpht.de/ninharp/ha-ninlight"
assert manifest["issue_tracker"] == "https://gitea.zukunpht.de/ninharp/ha-ninlight/issues"