Files
ha-ninlight/tests_unit/test_manifest.py
T

21 lines
696 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"]