1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 14:08:21 +00:00

Raise ConfigEntryAuthFailed during setup or coordinator update to start reauth (#48962)

This commit is contained in:
J. Nick Koston
2021-04-09 19:41:29 -10:00
committed by GitHub
parent 7cc857a298
commit 4cd7f9bd8b
51 changed files with 534 additions and 517 deletions

View File

@@ -761,7 +761,11 @@ async def test_setup_entry_no_token_reauth(hass: HomeAssistantType) -> None:
assert client.async_client_disconnect.called
mock_flow_init.assert_called_once_with(
DOMAIN,
context={CONF_SOURCE: SOURCE_REAUTH},
context={
CONF_SOURCE: SOURCE_REAUTH,
"entry_id": config_entry.entry_id,
"unique_id": config_entry.unique_id,
},
data=config_entry.data,
)
assert config_entry.state == ENTRY_STATE_SETUP_ERROR
@@ -785,7 +789,11 @@ async def test_setup_entry_bad_token_reauth(hass: HomeAssistantType) -> None:
assert client.async_client_disconnect.called
mock_flow_init.assert_called_once_with(
DOMAIN,
context={CONF_SOURCE: SOURCE_REAUTH},
context={
CONF_SOURCE: SOURCE_REAUTH,
"entry_id": config_entry.entry_id,
"unique_id": config_entry.unique_id,
},
data=config_entry.data,
)
assert config_entry.state == ENTRY_STATE_SETUP_ERROR