Move imports to top for spc (#29547)
* Move imports to top for spc * Fix pylint error by removing duplicate import
This commit is contained in:
1 parent
d9b52ef98c
commit
606d310ea3
4 files changed
+15
-15
No files matched your search
@@ -13,7 +13,8 @@ async def test_valid_device_config(hass, monkeypatch):
|
||||
config = {"spc": {"api_url": "http://localhost/", "ws_url": "ws://localhost/"}}
|
||||
|
||||
with patch(
|
||||
"pyspcwebgw.SpcWebGateway.async_load_parameters", return_value=mock_coro(True)
|
||||
"homeassistant.components.spc.SpcWebGateway.async_load_parameters",
|
||||
return_value=mock_coro(True),
|
||||
):
|
||||
assert await async_setup_component(hass, "spc", config) is True
|
||||
|
||||
@@ -23,7 +24,8 @@ async def test_invalid_device_config(hass, monkeypatch):
|
||||
config = {"spc": {"api_url": "http://localhost/"}}
|
||||
|
||||
with patch(
|
||||
"pyspcwebgw.SpcWebGateway.async_load_parameters", return_value=mock_coro(True)
|
||||
"homeassistant.components.spc.SpcWebGateway.async_load_parameters",
|
||||
return_value=mock_coro(True),
|
||||
):
|
||||
assert await async_setup_component(hass, "spc", config) is False
|
||||
|
||||
@@ -45,11 +47,11 @@ async def test_update_alarm_device(hass):
|
||||
area_mock.verified_alarm = False
|
||||
|
||||
with patch(
|
||||
"pyspcwebgw.SpcWebGateway.areas", new_callable=PropertyMock
|
||||
"homeassistant.components.spc.SpcWebGateway.areas", new_callable=PropertyMock
|
||||
) as mock_areas:
|
||||
mock_areas.return_value = {"1": area_mock}
|
||||
with patch(
|
||||
"pyspcwebgw.SpcWebGateway.async_load_parameters",
|
||||
"homeassistant.components.spc.SpcWebGateway.async_load_parameters",
|
||||
return_value=mock_coro(True),
|
||||
):
|
||||
assert await async_setup_component(hass, "spc", config) is True
|
||||
|
||||
Reference in new issue
Block a user