"""The manifest must agree with the constants the code relies on.""" from __future__ import annotations import json from pathlib import Path from custom_components.ninstrip.const import DOMAIN MANIFEST = Path(__file__).parents[1] / "custom_components" / "ninstrip" / "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": "_ninstrip._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-ninstrip" assert manifest["issue_tracker"] == "https://gitea.zukunpht.de/ninharp/ha-ninstrip/issues"