Use MockConfigEntry flow helpers in Nederlandse Spoorwegen tests (#186450)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Joost Lekkerkerker
2026-10-14 16:53:12 +02:00
committed by GitHub
co-authored by Claude
parent 7fe7b111cb
commit 7c11d78994
@@ -12,7 +12,7 @@ from homeassistant.components.nederlandse_spoorwegen.const import (
CONF_VIA,
DOMAIN,
)
from homeassistant.config_entries import SOURCE_RECONFIGURE, SOURCE_USER
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_API_KEY, CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultType
@@ -167,10 +167,7 @@ async def test_reconfigure_success(
mock_config_entry.add_to_hass(hass)
# Start reconfigure flow
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_RECONFIGURE, "entry_id": mock_config_entry.entry_id},
)
result = await mock_config_entry.start_reconfigure_flow(hass)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "reconfigure"
@@ -207,10 +204,7 @@ async def test_reconfigure_errors(
mock_config_entry.add_to_hass(hass)
# First present the form
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_RECONFIGURE, "entry_id": mock_config_entry.entry_id},
)
result = await mock_config_entry.start_reconfigure_flow(hass)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "reconfigure"
@@ -253,10 +247,7 @@ async def test_reconfigure_already_configured(
second_entry.add_to_hass(hass)
# Start reconfigure flow for the first entry
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_RECONFIGURE, "entry_id": mock_config_entry.entry_id},
)
result = await mock_config_entry.start_reconfigure_flow(hass)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "reconfigure"