mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-01-09 06:17:08 +00:00
fix test
This commit is contained in:
parent
541cd531f8
commit
1492e14077
@ -7,7 +7,6 @@ from asyncclick.testing import CliRunner
|
||||
|
||||
from kasa import SmartDevice, TPLinkSmartHomeProtocol
|
||||
from kasa.cli import (
|
||||
TYPE_TO_CLASS,
|
||||
alias,
|
||||
brightness,
|
||||
cli,
|
||||
@ -17,6 +16,8 @@ from kasa.cli import (
|
||||
sysinfo,
|
||||
toggle,
|
||||
)
|
||||
from kasa.device_factory import DEVICE_TYPE_TO_CLASS
|
||||
from kasa.device_type import DeviceType
|
||||
from kasa.discover import Discover
|
||||
|
||||
from .conftest import handle_turn_on, turn_on
|
||||
@ -154,14 +155,9 @@ async def test_credentials(discovery_data: dict, mocker):
|
||||
)
|
||||
|
||||
mocker.patch("kasa.cli.state", new=_state)
|
||||
|
||||
# Get the type string parameter from the discovery_info
|
||||
for cli_device_type in { # noqa: B007
|
||||
i
|
||||
for i in TYPE_TO_CLASS
|
||||
if TYPE_TO_CLASS[i] == Discover._get_device_class(discovery_data)
|
||||
}:
|
||||
break
|
||||
cli_device_type = Discover._get_device_class(discovery_data)(
|
||||
"any"
|
||||
).device_type.value
|
||||
|
||||
runner = CliRunner()
|
||||
res = await runner.invoke(
|
||||
|
Loading…
Reference in New Issue
Block a user