mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix totalconnect test calling public host (#51138)
This commit is contained in:
parent
ca8d09e5e1
commit
e08de22737
@ -135,15 +135,14 @@ async def test_reauth(hass):
|
|||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN, context={"source": SOURCE_REAUTH}, data=entry.data
|
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["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||||
assert result["step_id"] == "reauth_confirm"
|
assert result["step_id"] == "reauth_confirm"
|
||||||
|
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.totalconnect.config_flow.TotalConnectClient.TotalConnectClient"
|
"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
|
# first test with an invalid password
|
||||||
client_mock.return_value.is_valid_credentials.return_value = False
|
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["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
||||||
assert result["reason"] == "reauth_successful"
|
assert result["reason"] == "reauth_successful"
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
assert len(hass.config_entries.async_entries()) == 1
|
assert len(hass.config_entries.async_entries()) == 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user