1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Use FlowResultType enum in config flow tests A-M (#114681)

This commit is contained in:
Joost Lekkerkerker
2024-04-03 09:21:17 +02:00
committed by GitHub
parent a767530970
commit b9281327c4
111 changed files with 997 additions and 961 deletions

View File

@@ -30,7 +30,7 @@ async def test_form_user(hass: HomeAssistant) -> None:
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == "form"
assert result["type"] is FlowResultType.FORM
assert result["errors"] == {}
with (
@@ -113,7 +113,7 @@ async def test_zeroconf_discovery(hass: HomeAssistant) -> None:
)
await hass.async_block_till_done()
assert result2["type"] == "create_entry"
assert result2["type"] is FlowResultType.CREATE_ENTRY
assert result2["title"] == "My Fan"
assert result2["data"] == {CONF_IP_ADDRESS: "127.0.0.1"}
assert len(mock_setup_entry.mock_calls) == 1
@@ -182,7 +182,7 @@ async def test_user_flow_is_not_blocked_by_discovery(hass: HomeAssistant) -> Non
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == "form"
assert result["type"] is FlowResultType.FORM
assert result["errors"] == {}
with (