From 3d38905ff7412d954e6ec4f5a05f33a996e79549 Mon Sep 17 00:00:00 2001 From: Manu Date: Sat, 3 Oct 2026 19:58:49 +0200 Subject: [PATCH] Split user flow init and data submission in songpal config flow tests (#184098) --- tests/components/songpal/test_config_flow.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/components/songpal/test_config_flow.py b/tests/components/songpal/test_config_flow.py index 0ae2ab596db5..3bda9860b36d 100644 --- a/tests/components/songpal/test_config_flow.py +++ b/tests/components/songpal/test_config_flow.py @@ -192,10 +192,16 @@ async def test_user_exist(hass: HomeAssistant) -> None: """Test user adding existed device.""" mocked_device = _create_mocked_device() _create_mock_config_entry(hass) + result = await hass.config_entries.flow.async_init( + DOMAIN, context={"source": SOURCE_USER} + ) + assert result["type"] is FlowResultType.FORM + assert result["step_id"] == "user" + assert not result["errors"] with _patch_config_flow_device(mocked_device): - result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_USER}, data=CONF_DATA + result = await hass.config_entries.flow.async_configure( + result["flow_id"], user_input={CONF_ENDPOINT: ENDPOINT} ) assert result["type"] is FlowResultType.ABORT assert result["reason"] == "already_configured" @@ -224,10 +230,16 @@ async def test_user_invalid(hass: HomeAssistant) -> None: """Test using adding invalid config.""" mocked_device = _create_mocked_device(True) _create_mock_config_entry(hass) + result = await hass.config_entries.flow.async_init( + DOMAIN, context={"source": SOURCE_USER} + ) + assert result["type"] is FlowResultType.FORM + assert result["step_id"] == "user" + assert not result["errors"] with _patch_config_flow_device(mocked_device): - result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_USER}, data=CONF_DATA + result = await hass.config_entries.flow.async_configure( + result["flow_id"], user_input={CONF_ENDPOINT: ENDPOINT} ) assert result["type"] is FlowResultType.FORM assert result["step_id"] == "user"