mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 03:33:35 +00:00
1803a83ae6
* test_cli: provide return values to patched objects to avoid warning about non-awaited calls * test_cli: restore alias after testing * smartstrip: remove internal update() calls for turn_{on,off}, set_led * Make sure power is always a float * Fix discovery tests * Make tests runnable on real devices * Add a note about running tests on a real device * test_strip: run update against the parent device
31 lines
605 B
Python
31 lines
605 B
Python
from kasa import DeviceType
|
|
|
|
from .conftest import plug, pytestmark
|
|
from .newfakes import PLUG_SCHEMA
|
|
|
|
|
|
@plug
|
|
async def test_plug_sysinfo(dev):
|
|
assert dev.sys_info is not None
|
|
PLUG_SCHEMA(dev.sys_info)
|
|
|
|
assert dev.model is not None
|
|
|
|
assert dev.device_type == DeviceType.Plug or dev.device_type == DeviceType.Strip
|
|
assert dev.is_plug or dev.is_strip
|
|
|
|
|
|
@plug
|
|
async def test_led(dev):
|
|
original = dev.led
|
|
|
|
await dev.set_led(False)
|
|
await dev.update()
|
|
assert not dev.led
|
|
|
|
await dev.set_led(True)
|
|
await dev.update()
|
|
assert dev.led
|
|
|
|
await dev.set_led(original)
|