From ed6cfa42f041dbe1bff4804215968527b4cbf2ad Mon Sep 17 00:00:00 2001 From: Guido Schmitz Date: Fri, 9 May 2025 15:33:13 +0200 Subject: [PATCH] Make all devolo Home Network conflig flow tests end correctly (#144378) --- .../devolo_home_network/test_config_flow.py | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/components/devolo_home_network/test_config_flow.py b/tests/components/devolo_home_network/test_config_flow.py index 923b7298893..16d3e6a8b9e 100644 --- a/tests/components/devolo_home_network/test_config_flow.py +++ b/tests/components/devolo_home_network/test_config_flow.py @@ -77,14 +77,30 @@ async def test_form_error(hass: HomeAssistant, exception_type, expected_error) - ): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], - { - CONF_IP_ADDRESS: IP, - }, + {CONF_IP_ADDRESS: IP, CONF_PASSWORD: ""}, ) assert result2["type"] is FlowResultType.FORM assert result2["errors"] == {CONF_BASE: expected_error} + with ( + patch( + "homeassistant.components.devolo_home_network.async_setup_entry", + return_value=True, + ), + patch( + "homeassistant.components.devolo_home_network.config_flow.Device", + new=MockDevice, + ), + ): + result3 = await hass.config_entries.flow.async_configure( + result2["flow_id"], + {CONF_IP_ADDRESS: IP, CONF_PASSWORD: ""}, + ) + await hass.async_block_till_done() + + assert result3["type"] is FlowResultType.CREATE_ENTRY + async def test_zeroconf(hass: HomeAssistant) -> None: """Test that the zeroconf form is served."""