diff --git a/src/tests/ha_addon_sunsynk_multi/test_definitions3ph.py b/src/tests/ha_addon_sunsynk_multi/test_definitions3ph.py deleted file mode 100644 index 68a329ae..00000000 --- a/src/tests/ha_addon_sunsynk_multi/test_definitions3ph.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Test 3ph defs.""" - -from sunsynk.definitions.single_phase import SENSORS as SENSORS1P -from sunsynk.definitions.three_phase_common import SENSORS as SENSORS3P - - -def test_ok() -> None: - """Test.""" - assert len(SENSORS1P.serial.address) == len(SENSORS3P.serial.address) - assert SENSORS1P.rated_power - assert SENSORS3P.rated_power diff --git a/src/tests/sunsynk/definitions/__init__.py b/src/tests/sunsynk/definitions/__init__.py new file mode 100644 index 00000000..e4390193 --- /dev/null +++ b/src/tests/sunsynk/definitions/__init__.py @@ -0,0 +1 @@ +"""Sensor definitions.""" diff --git a/src/tests/sunsynk/definitions/test_init.py b/src/tests/sunsynk/definitions/test_init.py new file mode 100644 index 00000000..6a347fc6 --- /dev/null +++ b/src/tests/sunsynk/definitions/test_init.py @@ -0,0 +1,16 @@ +"""Test sensor definitions.""" + +from sunsynk.definitions import import_defs + + +def test_import_defs() -> None: + """Test importing sensors.""" + libs = ( + "single_phase", + "three_phase_hv", + "three_phase_lv", + ) + for lib in libs: + defs = import_defs(lib) + assert len(defs.all) > 50 + assert defs.rated_power