Make all devolo Home Network conflig flow tests end correctly (#144378)

This commit is contained in:
Guido Schmitz 2025-05-09 15:33:13 +02:00 committed by GitHub
parent 763f2bcfcc
commit ed6cfa42f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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."""