Debian Codegraph @

tests/test_lights.py

raw symbols SCIP
1 """Test pydeCONZ lights.
2
3 pytest --cov-report term-missing --cov=pydeconz.light tests/test_lights.py
4 """
5
6 from tests import lights as light_test_data
7
8
9 async def test_create_all_light_types(deconz_refresh_state):
10 """Verify that light types work."""
11 deconz_session = await deconz_refresh_state(
12 lights={
13 "0": light_test_data.test_configuration_tool.DATA,
14 "1": light_test_data.test_cover.DATA,
15 "2": light_test_data.test_light.DATA,
16 "3": light_test_data.test_lock.DATA,
17 "4": light_test_data.test_siren.DATA,
18 "5": {"type": "unsupported device"},
19 },
20 )
21
22 lights = deconz_session.lights
23 assert len(lights._handlers) == 6
24 assert lights["0"].type == "Configuration tool"
25 assert lights["1"].type == "Window covering device"
26 assert lights["2"].type == "Extended color light"
27 assert lights["3"].type == "Door Lock"
28 assert lights["4"].type == "Warning device"
29 assert lights["5"].type == "unsupported device" # legacy support