Various test code cleanups (#725)

* Separate fake protocols for iot and smart

* Move control_child impl into its own method

* Organize schemas into correct places

* Add test_childdevice

* Add missing return for _handle_control_child
This commit is contained in:
Teemu R
2024-01-29 20:26:39 +01:00
committed by GitHub
parent 1e26434205
commit 9e6896a08f
8 changed files with 332 additions and 304 deletions

View File

@@ -1,13 +1,17 @@
from kasa import DeviceType
from .conftest import plug, plug_smart
from .newfakes import PLUG_SCHEMA
from .test_smartdevice import SYSINFO_SCHEMA
# these schemas should go to the mainlib as
# they can be useful when adding support for new features/devices
# as well as to check that faked devices are operating properly.
@plug
async def test_plug_sysinfo(dev):
assert dev.sys_info is not None
PLUG_SCHEMA(dev.sys_info)
SYSINFO_SCHEMA(dev.sys_info)
assert dev.model is not None