Add PIN recovery test to Subaru config flow (#178679)

This commit is contained in:
John Pettitt
2026-08-11 22:14:02 +08:00
committed by GitHub
parent dbd5592065
commit 3565649072
+11 -1
View File
@@ -349,7 +349,7 @@ async def test_pin_form_success(hass: HomeAssistant, pin_form) -> None:
async def test_pin_form_incorrect_pin(hass: HomeAssistant, pin_form) -> None:
"""Test we handle invalid pin."""
"""Test we handle invalid pin, and that the flow can still be completed afterward."""
with (
patch(
MOCK_API_TEST_PIN,
@@ -368,6 +368,16 @@ async def test_pin_form_incorrect_pin(hass: HomeAssistant, pin_form) -> None:
assert result["type"] is FlowResultType.FORM
assert result["errors"] == {"base": "incorrect_pin"}
with (
patch(MOCK_API_TEST_PIN, return_value=True),
patch(MOCK_API_UPDATE_SAVED_PIN, return_value=True),
patch(ASYNC_SETUP_ENTRY, return_value=True),
):
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input={CONF_PIN: TEST_PIN}
)
assert result["type"] is FlowResultType.CREATE_ENTRY
async def test_option_flow_form(options_form) -> None:
"""Test config flow options form."""