Bump python-broadlink to 0.15.0 (#39228)

* Rename DeviceOfflineError to NetworkTimeoutError

* Bump python-broadlink to 0.15
This commit is contained in:
Felipe Martins Diel authored and GitHub committed 2020-09-26 10:46:02 -05:00
1 parent 6977425d04
commit 2f4aa35ca6
9 files changed
+26 -26

No files matched your search

@@ -249,11 +249,11 @@ async def test_flow_auth_authentication_error(hass):
assert result["errors"] == {"base": "invalid_auth"}
async def test_flow_auth_device_offline(hass):
"""Test we handle a device offline in the auth step."""
async def test_flow_auth_network_timeout(hass):
"""Test we handle a network timeout in the auth step."""
device = get_device("Living Room")
mock_api = device.get_mock_api()
mock_api.auth.side_effect = blke.DeviceOfflineError()
mock_api.auth.side_effect = blke.NetworkTimeoutError()
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
@@ -403,12 +403,12 @@ async def test_flow_unlock_works(hass):
assert mock_api.set_lock.call_count == 1
async def test_flow_unlock_device_offline(hass):
"""Test we handle a device offline in the unlock step."""
async def test_flow_unlock_network_timeout(hass):
"""Test we handle a network timeout in the unlock step."""
device = get_device("Living Room")
mock_api = device.get_mock_api()
mock_api.is_locked = True
mock_api.set_lock.side_effect = blke.DeviceOfflineError
mock_api.set_lock.side_effect = blke.NetworkTimeoutError()
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
+7 -7
View File
@@ -62,11 +62,11 @@ async def test_device_setup_authentication_error(hass):
}
async def test_device_setup_device_offline(hass):
"""Test we handle a device offline."""
async def test_device_setup_network_timeout(hass):
"""Test we handle a network timeout."""
device = get_device("Office")
mock_api = device.get_mock_api()
mock_api.auth.side_effect = blke.DeviceOfflineError()
mock_api.auth.side_effect = blke.NetworkTimeoutError()
with patch.object(
hass.config_entries, "async_forward_entry_setup"
@@ -119,11 +119,11 @@ async def test_device_setup_broadlink_exception(hass):
assert mock_init.call_count == 0
async def test_device_setup_update_device_offline(hass):
"""Test we handle a device offline in the update step."""
async def test_device_setup_update_network_timeout(hass):
"""Test we handle a network timeout in the update step."""
device = get_device("Office")
mock_api = device.get_mock_api()
mock_api.check_sensors.side_effect = blke.DeviceOfflineError()
mock_api.check_sensors.side_effect = blke.NetworkTimeoutError()
with patch.object(
hass.config_entries, "async_forward_entry_setup"
@@ -308,7 +308,7 @@ async def test_device_unload_update_failed(hass):
"""Test we unload a device that failed the update step."""
device = get_device("Office")
mock_api = device.get_mock_api()
mock_api.check_sensors.side_effect = blke.DeviceOfflineError()
mock_api.check_sensors.side_effect = blke.NetworkTimeoutError()
with patch.object(hass.config_entries, "async_forward_entry_setup"):
_, mock_entry = await device.setup_entry(hass, mock_api=mock_api)