Introduce reauth flow to deCONZ (#45443)
This commit is contained in:
parent
18c7ae9a8b
commit
57fa7f926a
4 changed files with 95 additions and 23 deletions
|
@ -181,6 +181,18 @@ async def test_update_address(hass):
|
|||
assert len(mock_setup_entry.mock_calls) == 1
|
||||
|
||||
|
||||
async def test_gateway_trigger_reauth_flow(hass):
|
||||
"""Failed authentication trigger a reauthentication flow."""
|
||||
with patch(
|
||||
"homeassistant.components.deconz.gateway.get_gateway",
|
||||
side_effect=AuthenticationRequired,
|
||||
), patch.object(hass.config_entries.flow, "async_init") as mock_flow_init:
|
||||
await setup_deconz_integration(hass)
|
||||
mock_flow_init.assert_called_once()
|
||||
|
||||
assert hass.data[DECONZ_DOMAIN] == {}
|
||||
|
||||
|
||||
async def test_reset_after_successful_setup(hass):
|
||||
"""Make sure that connection status triggers a dispatcher send."""
|
||||
config_entry = await setup_deconz_integration(hass)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue