From e5e8a48b9c9018136a83db28887af1a4a97407d4 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 30 Aug 2026 12:16:41 +0200 Subject: [PATCH] Split the LiteJet user flow init from its data (#180738) --- tests/components/litejet/test_config_flow.py | 24 ++++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tests/components/litejet/test_config_flow.py b/tests/components/litejet/test_config_flow.py index 7b8fa481b697..53c5ba556778 100644 --- a/tests/components/litejet/test_config_flow.py +++ b/tests/components/litejet/test_config_flow.py @@ -28,7 +28,15 @@ async def test_create_entry(hass: HomeAssistant, mock_litejet) -> None: test_data = {CONF_PORT: "/dev/test"} result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data=test_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=test_data, ) assert result["type"] is FlowResultType.CREATE_ENTRY @@ -44,10 +52,8 @@ async def test_flow_entry_already_exists(hass: HomeAssistant) -> None: ) first_entry.add_to_hass(hass) - test_data = {CONF_PORT: "/dev/test"} - result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data=test_data + DOMAIN, context={"source": config_entries.SOURCE_USER} ) assert result["type"] is FlowResultType.ABORT @@ -62,7 +68,15 @@ async def test_flow_open_failed(hass: HomeAssistant) -> None: mock_pylitejet.side_effect = SerialException result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data=test_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=test_data, ) assert result["type"] is FlowResultType.FORM