mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
strip unused
This commit is contained in:
parent
38f21946ae
commit
911ea4ed8e
@ -7,7 +7,6 @@ import pytest # type: ignore # https://github.com/pytest-dev/pytest/issues/3342
|
||||
import kasa
|
||||
from kasa import Credentials, SmartDevice, SmartDeviceException
|
||||
from kasa.smartdevice import DeviceType
|
||||
from kasa.smartstrip import SmartStripPlug
|
||||
|
||||
from .conftest import handle_turn_on, has_emeter, no_emeter, turn_on
|
||||
from .newfakes import PLUG_SCHEMA, TZ_SCHEMA, FakeTransportProtocol
|
||||
@ -59,28 +58,6 @@ async def test_initial_update_no_emeter(dev, mocker):
|
||||
assert spy.call_count == 2
|
||||
|
||||
|
||||
async def test_smart_device_from_value():
|
||||
"""Make sure that every device type can be created from its value."""
|
||||
for name in DeviceType:
|
||||
assert DeviceType.from_value(name.value) is not None
|
||||
|
||||
assert DeviceType.from_value("nonexistent") is DeviceType.Unknown
|
||||
assert DeviceType.from_value("plug") is DeviceType.Plug
|
||||
assert DeviceType.Plug.value == "plug"
|
||||
|
||||
assert DeviceType.from_value("bulb") is DeviceType.Bulb
|
||||
assert DeviceType.Bulb.value == "bulb"
|
||||
|
||||
assert DeviceType.from_value("dimmer") is DeviceType.Dimmer
|
||||
assert DeviceType.Dimmer.value == "dimmer"
|
||||
|
||||
assert DeviceType.from_value("strip") is DeviceType.Strip
|
||||
assert DeviceType.Strip.value == "strip"
|
||||
|
||||
assert DeviceType.from_value("lightstrip") is DeviceType.LightStrip
|
||||
assert DeviceType.LightStrip.value == "lightstrip"
|
||||
|
||||
|
||||
async def test_query_helper(dev):
|
||||
with pytest.raises(SmartDeviceException):
|
||||
await dev._query_helper("test", "testcmd", {})
|
||||
|
Loading…
Reference in New Issue
Block a user