Perform re-login after Fritzbox has rebooted (#64709)

This commit is contained in:
Michael 2022-01-24 12:25:29 +01:00 committed by GitHub
parent 2a00c096db
commit 6874b49a39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 26 deletions

View file

@ -163,10 +163,11 @@ async def test_coordinator_update_after_reboot(hass: HomeAssistant, fritz: Mock)
unique_id="any",
)
entry.add_to_hass(hass)
fritz().get_devices.side_effect = [HTTPError(), ""]
fritz().update_devices.side_effect = [HTTPError(), ""]
assert await hass.config_entries.async_setup(entry.entry_id)
assert fritz().get_devices.call_count == 2
assert fritz().update_devices.call_count == 2
assert fritz().get_devices.call_count == 1
assert fritz().login.call_count == 2
@ -180,11 +181,12 @@ async def test_coordinator_update_after_password_change(
unique_id="any",
)
entry.add_to_hass(hass)
fritz().get_devices.side_effect = HTTPError()
fritz().update_devices.side_effect = HTTPError()
fritz().login.side_effect = ["", LoginError("some_user")]
assert not await hass.config_entries.async_setup(entry.entry_id)
assert fritz().get_devices.call_count == 1
assert fritz().update_devices.call_count == 1
assert fritz().get_devices.call_count == 0
assert fritz().login.call_count == 2