python-kasa/kasa/tests/test_plug.py
Julian Davis 866c8d6db5
Fix pytest warnings about asyncio (#397)
Turn on ayncio auto mode for pytest and remove the global async marking flag
2022-11-13 23:34:47 +01:00

31 lines
593 B
Python

from kasa import DeviceType
from .conftest import plug
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)