isort and black on the tests

This commit is contained in:
Bas Nijholt 2019-11-11 20:31:56 +01:00
parent 55d898b547
commit 9907c6416b
4 changed files with 30 additions and 24 deletions

View File

@ -1,11 +1,14 @@
import asyncio
import pytest
import glob
import json
import os
from .newfakes import FakeTransportProtocol
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(
os.path.dirname(os.path.abspath(__file__)) + "/fixtures/*.json"

View File

@ -1,7 +1,9 @@
from ..protocol import TPLinkSmartHomeProtocol
import logging
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__)

View File

@ -1,32 +1,32 @@
import asyncio
import datetime
from unittest.mock import patch
import pytest
from pyHS100 import DeviceType, SmartStripException, SmartDeviceException
from .newfakes import (
BULB_SCHEMA,
PLUG_SCHEMA,
FakeTransportProtocol,
CURRENT_CONSUMPTION_SCHEMA,
TZ_SCHEMA,
)
from pyHS100 import DeviceType, SmartDeviceException, SmartStripException
from .conftest import (
turn_on,
handle_turn_on,
plug,
strip,
bulb,
color_bulb,
non_color_bulb,
dimmable,
handle_turn_on,
has_emeter,
no_emeter,
dimmable,
non_color_bulb,
non_dimmable,
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):
import re
pattern = re.compile("<.* model .* at .* (.*), is_on: .* - dev specific: .*>")
assert pattern.match(str(dev))

View File

@ -1,6 +1,7 @@
from unittest import TestCase
from ..protocol import TPLinkSmartHomeProtocol
import json
from unittest import TestCase
from ..protocol import TPLinkSmartHomeProtocol
class TestTPLinkSmartHomeProtocol(TestCase):