Split the ROMY user flow init from its data (#180680)

This commit is contained in:
Franck Nijhof
2026-08-29 21:01:19 +02:00
committed by GitHub
parent 47fad86d7c
commit a1eba846af
+24 -9
View File
@@ -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"