mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 23:41:48 -05:00
Split the ROMY user flow init from its data (#180680)
This commit is contained in:
@@ -64,9 +64,14 @@ async def test_show_user_form_robot_is_offline_and_locked(hass: HomeAssistant) -
|
||||
return_value=_create_mocked_romy(False, False),
|
||||
):
|
||||
result1 = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_USER},
|
||||
data=INPUT_CONFIG_HOST,
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result1["type"] is FlowResultType.FORM
|
||||
assert result1["step_id"] == "user"
|
||||
|
||||
result1 = await hass.config_entries.flow.async_configure(
|
||||
result1["flow_id"], user_input=INPUT_CONFIG_HOST
|
||||
)
|
||||
|
||||
assert result1["errors"].get("host") == "cannot_connect"
|
||||
@@ -106,9 +111,14 @@ async def test_show_user_form_robot_unlock_with_password(hass: HomeAssistant) ->
|
||||
return_value=_create_mocked_romy(True, False),
|
||||
):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_USER},
|
||||
data=INPUT_CONFIG_HOST,
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "user"
|
||||
|
||||
result = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"], user_input=INPUT_CONFIG_HOST
|
||||
)
|
||||
|
||||
with patch(
|
||||
@@ -156,9 +166,14 @@ async def test_show_user_form_robot_reachable_again(hass: HomeAssistant) -> None
|
||||
return_value=_create_mocked_romy(False, False),
|
||||
):
|
||||
result1 = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_USER},
|
||||
data=INPUT_CONFIG_HOST,
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result1["type"] is FlowResultType.FORM
|
||||
assert result1["step_id"] == "user"
|
||||
|
||||
result1 = await hass.config_entries.flow.async_configure(
|
||||
result1["flow_id"], user_input=INPUT_CONFIG_HOST
|
||||
)
|
||||
|
||||
assert result1["errors"].get("host") == "cannot_connect"
|
||||
|
||||
Reference in New Issue
Block a user