mirror of
https://github.com/home-assistant/core.git
synced 2026-09-25 17:04:04 -04:00
Split the AEMET user flow init from its data (#180768)
This commit is contained in:
@@ -136,7 +136,15 @@ async def test_form_duplicated_id(
|
||||
entry.add_to_hass(hass)
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_USER}, data=CONFIG
|
||||
DOMAIN, context={"source": 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=CONFIG,
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.ABORT
|
||||
@@ -153,7 +161,15 @@ async def test_form_auth_error(hass: HomeAssistant) -> None:
|
||||
return_value=mocked_aemet,
|
||||
):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_USER}, data=CONFIG
|
||||
DOMAIN, context={"source": 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=CONFIG,
|
||||
)
|
||||
|
||||
assert result["errors"] == {"base": "invalid_api_key"}
|
||||
|
||||
Reference in New Issue
Block a user