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

Remove deprecated start of flow no link to config entry (#155956)

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
G Johansson
2025-11-09 20:16:56 +01:00
committed by GitHub
parent f53c581845
commit b9fb4469d8
2 changed files with 13 additions and 18 deletions

View File

@@ -5983,9 +5983,8 @@ async def test_reauth_reconfigure_missing_entry(
await hass.async_block_till_done()
with pytest.raises(
RuntimeError,
match=f"Detected code that initialises a {source} flow without a link "
"to the config entry. Please report this issue",
HomeAssistantError,
match=f"Cannot initialize a {source} flow without a link to the config entry",
):
await manager.flow.async_init("test", context={"source": source})
await hass.async_block_till_done()
@@ -6002,7 +6001,6 @@ async def test_reauth_reconfigure_missing_entry_component(
hass: HomeAssistant,
manager: config_entries.ConfigEntries,
source: str,
caplog: pytest.LogCaptureFixture,
) -> None:
"""Test the async_reauth_helper."""
entry = MockConfigEntry(title="test_title", domain="test")
@@ -6015,19 +6013,18 @@ async def test_reauth_reconfigure_missing_entry_component(
await manager.async_setup(entry.entry_id)
await hass.async_block_till_done()
with patch.object(frame, "_REPORTED_INTEGRATIONS", set()):
with (
patch.object(frame, "_REPORTED_INTEGRATIONS", set()),
pytest.raises(
HomeAssistantError,
match=f"Cannot initialize a {source} flow without a link to the config entry",
),
):
await manager.flow.async_init("test", context={"source": source})
await hass.async_block_till_done()
# Flow still created, but deprecation logged
# Flow is not created
flows = hass.config_entries.flow.async_progress()
assert len(flows) == 1
assert flows[0]["context"]["source"] == source
assert (
f"Detected that integration 'hue' initialises a {source} flow"
" without a link to the config entry at homeassistant/components" in caplog.text
)
assert len(flows) == 0
async def test_reconfigure(