1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 09:38:58 +01:00

Improve efficiency of config_entries _async_abort_entries_match() (#148344)

Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick+github@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
HarvsG
2025-09-08 21:17:29 +01:00
committed by GitHub
parent 0444467858
commit 2e2b9483df
2 changed files with 16 additions and 1 deletions
+13
View File
@@ -5334,6 +5334,19 @@ async def test_async_abort_entries_match(
assert result["type"] == FlowResultType.ABORT
assert result["reason"] == reason
# For a domain with no entries, there should never be a match
mock_integration(hass, MockModule("not_comp", async_setup_entry=mock_setup_entry))
mock_platform(hass, "not_comp.config_flow", None)
with mock_config_flow("not_comp", TestFlow), mock_config_flow("invalid_flow", 5):
result = await manager.flow.async_init(
"not_comp", context={"source": config_entries.SOURCE_USER}
)
await hass.async_block_till_done()
assert result["type"] == FlowResultType.ABORT
assert result["reason"] == "no_match"
@pytest.mark.parametrize(
("matchers", "reason"),