mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-04-26 16:46:23 +00:00
isort and black on the tests
This commit is contained in:
parent
55d898b547
commit
9907c6416b
@ -1,11 +1,14 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import pytest
|
|
||||||
import glob
|
import glob
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from .newfakes import FakeTransportProtocol
|
|
||||||
from os.path import basename
|
from os.path import basename
|
||||||
from pyHS100 import SmartPlug, SmartBulb, SmartStrip, Discover
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from pyHS100 import Discover, SmartBulb, SmartPlug, SmartStrip
|
||||||
|
|
||||||
|
from .newfakes import FakeTransportProtocol
|
||||||
|
|
||||||
SUPPORTED_DEVICES = glob.glob(
|
SUPPORTED_DEVICES = glob.glob(
|
||||||
os.path.dirname(os.path.abspath(__file__)) + "/fixtures/*.json"
|
os.path.dirname(os.path.abspath(__file__)) + "/fixtures/*.json"
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
from ..protocol import TPLinkSmartHomeProtocol
|
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
from voluptuous import Schema, Range, All, Any, Coerce, Invalid, Optional, REMOVE_EXTRA
|
|
||||||
|
from voluptuous import REMOVE_EXTRA, All, Any, Coerce, Invalid, Optional, Range, Schema
|
||||||
|
|
||||||
|
from ..protocol import TPLinkSmartHomeProtocol
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from pyHS100 import DeviceType, SmartStripException, SmartDeviceException
|
from pyHS100 import DeviceType, SmartDeviceException, SmartStripException
|
||||||
from .newfakes import (
|
|
||||||
BULB_SCHEMA,
|
|
||||||
PLUG_SCHEMA,
|
|
||||||
FakeTransportProtocol,
|
|
||||||
CURRENT_CONSUMPTION_SCHEMA,
|
|
||||||
TZ_SCHEMA,
|
|
||||||
)
|
|
||||||
from .conftest import (
|
from .conftest import (
|
||||||
turn_on,
|
|
||||||
handle_turn_on,
|
|
||||||
plug,
|
|
||||||
strip,
|
|
||||||
bulb,
|
bulb,
|
||||||
color_bulb,
|
color_bulb,
|
||||||
non_color_bulb,
|
dimmable,
|
||||||
|
handle_turn_on,
|
||||||
has_emeter,
|
has_emeter,
|
||||||
no_emeter,
|
no_emeter,
|
||||||
dimmable,
|
non_color_bulb,
|
||||||
non_dimmable,
|
non_dimmable,
|
||||||
variable_temp,
|
|
||||||
non_variable_temp,
|
non_variable_temp,
|
||||||
|
plug,
|
||||||
|
strip,
|
||||||
|
turn_on,
|
||||||
|
variable_temp,
|
||||||
|
)
|
||||||
|
from .newfakes import (
|
||||||
|
BULB_SCHEMA,
|
||||||
|
CURRENT_CONSUMPTION_SCHEMA,
|
||||||
|
PLUG_SCHEMA,
|
||||||
|
TZ_SCHEMA,
|
||||||
|
FakeTransportProtocol,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -659,6 +659,6 @@ def test_cache_invalidates(dev):
|
|||||||
|
|
||||||
def test_representation(dev):
|
def test_representation(dev):
|
||||||
import re
|
import re
|
||||||
|
|
||||||
pattern = re.compile("<.* model .* at .* (.*), is_on: .* - dev specific: .*>")
|
pattern = re.compile("<.* model .* at .* (.*), is_on: .* - dev specific: .*>")
|
||||||
assert pattern.match(str(dev))
|
assert pattern.match(str(dev))
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from unittest import TestCase
|
|
||||||
from ..protocol import TPLinkSmartHomeProtocol
|
|
||||||
import json
|
import json
|
||||||
|
from unittest import TestCase
|
||||||
|
|
||||||
|
from ..protocol import TPLinkSmartHomeProtocol
|
||||||
|
|
||||||
|
|
||||||
class TestTPLinkSmartHomeProtocol(TestCase):
|
class TestTPLinkSmartHomeProtocol(TestCase):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user