From c6c9edf62492155d90106e614dac4e4fd8fa4829 Mon Sep 17 00:00:00 2001 From: Chris <53621277+smitec11@users.noreply.github.com> Date: Thu, 17 Sep 2026 21:21:34 +0200 Subject: [PATCH] Split user flow init and data submission in heos config flow tests (#182519) Co-authored-by: Claude Opus 5 --- tests/components/heos/test_config_flow.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/components/heos/test_config_flow.py b/tests/components/heos/test_config_flow.py index 9be5862d3f74..c9cad81fe4d8 100644 --- a/tests/components/heos/test_config_flow.py +++ b/tests/components/heos/test_config_flow.py @@ -62,7 +62,11 @@ async def test_cannot_connect_shows_error_form( """Test form is shown with error when cannot connect.""" controller.connect.side_effect = HeosError() result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_USER}, data={CONF_HOST: "127.0.0.1"} + DOMAIN, context={"source": SOURCE_USER} + ) + assert result["type"] is FlowResultType.FORM + result = await hass.config_entries.flow.async_configure( + result["flow_id"], user_input={CONF_HOST: "127.0.0.1"} ) assert result["type"] is FlowResultType.FORM assert result["step_id"] == "user" @@ -80,7 +84,11 @@ async def test_create_entry_when_host_valid( data = {CONF_HOST: "127.0.0.1"} result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_USER}, data=data + DOMAIN, context={"source": SOURCE_USER} + ) + assert result["type"] is FlowResultType.FORM + result = await hass.config_entries.flow.async_configure( + result["flow_id"], user_input=data ) assert result["type"] is FlowResultType.CREATE_ENTRY assert result["result"].unique_id == DOMAIN