Fix totalconnect test calling public host (#51138)

This commit is contained in:
jjlawren 2021-05-27 21:30:37 -05:00 committed by GitHub
parent ca8d09e5e1
commit e08de22737
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -135,15 +135,14 @@ async def test_reauth(hass):
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_REAUTH}, data=entry.data
)
assert result["step_id"] == "reauth_confirm"
result = await hass.config_entries.flow.async_configure(result["flow_id"])
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["step_id"] == "reauth_confirm"
with patch(
"homeassistant.components.totalconnect.config_flow.TotalConnectClient.TotalConnectClient"
) as client_mock:
) as client_mock, patch(
"homeassistant.components.totalconnect.async_setup_entry", return_value=True
):
# first test with an invalid password
client_mock.return_value.is_valid_credentials.return_value = False
@ -162,5 +161,6 @@ async def test_reauth(hass):
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["reason"] == "reauth_successful"
await hass.async_block_till_done()
assert len(hass.config_entries.async_entries()) == 1