From 69c46c588ef37edf3282cc836919650586535570 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 30 Aug 2026 11:50:21 +0200 Subject: [PATCH] Split the OwnTracks user flow init from its data (#180725) --- .../components/owntracks/test_config_flow.py | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/tests/components/owntracks/test_config_flow.py b/tests/components/owntracks/test_config_flow.py index 9fd22f3d5565..913824af86e3 100644 --- a/tests/components/owntracks/test_config_flow.py +++ b/tests/components/owntracks/test_config_flow.py @@ -131,7 +131,14 @@ async def test_unload(hass: HomeAssistant) -> None: "homeassistant.config_entries.ConfigEntries.async_forward_entry_setups" ) as mock_forward: result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data={} + 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={} ) assert len(mock_forward.mock_calls) == 1 @@ -168,7 +175,14 @@ async def test_with_cloud_sub(hass: HomeAssistant) -> None: ), ): result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data={} + 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={} ) assert result["type"] is FlowResultType.CREATE_ENTRY @@ -197,7 +211,14 @@ async def test_with_cloud_sub_not_connected(hass: HomeAssistant) -> None: ), ): result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data={} + 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={} ) assert result["type"] is FlowResultType.ABORT