From a1eba846afa23b072faf8bede287d72421d5d1d7 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 29 Aug 2026 21:01:19 +0200 Subject: [PATCH] Split the ROMY user flow init from its data (#180680) --- tests/components/romy/test_config_flow.py | 33 ++++++++++++++++------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/tests/components/romy/test_config_flow.py b/tests/components/romy/test_config_flow.py index 5286801ac0ee..b018d0d4c3e3 100644 --- a/tests/components/romy/test_config_flow.py +++ b/tests/components/romy/test_config_flow.py @@ -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"