mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Teach _async_abort_entries_match about entry options (#66662)
This commit is contained in:
@@ -2893,12 +2893,23 @@ async def test_setup_retrying_during_shutdown(hass):
|
||||
[
|
||||
({}, "already_configured"),
|
||||
({"host": "3.3.3.3"}, "no_match"),
|
||||
({"vendor": "no_match"}, "no_match"),
|
||||
({"host": "3.4.5.6"}, "already_configured"),
|
||||
({"host": "3.4.5.6", "ip": "3.4.5.6"}, "no_match"),
|
||||
({"host": "3.4.5.6", "ip": "1.2.3.4"}, "already_configured"),
|
||||
({"host": "3.4.5.6", "ip": "1.2.3.4", "port": 23}, "already_configured"),
|
||||
(
|
||||
{"host": "9.9.9.9", "ip": "6.6.6.6", "port": 12, "vendor": "zoo"},
|
||||
"already_configured",
|
||||
),
|
||||
({"vendor": "zoo"}, "already_configured"),
|
||||
({"ip": "9.9.9.9"}, "already_configured"),
|
||||
({"ip": "7.7.7.7"}, "no_match"), # ignored
|
||||
({"vendor": "data"}, "no_match"),
|
||||
(
|
||||
{"vendor": "options"},
|
||||
"already_configured",
|
||||
), # ensure options takes precedence over data
|
||||
],
|
||||
)
|
||||
async def test__async_abort_entries_match(hass, manager, matchers, reason):
|
||||
@@ -2917,6 +2928,16 @@ async def test__async_abort_entries_match(hass, manager, matchers, reason):
|
||||
source=config_entries.SOURCE_IGNORE,
|
||||
data={"ip": "7.7.7.7", "host": "4.5.6.7", "port": 23},
|
||||
).add_to_hass(hass)
|
||||
MockConfigEntry(
|
||||
domain="comp",
|
||||
data={"ip": "6.6.6.6", "host": "9.9.9.9", "port": 12},
|
||||
options={"vendor": "zoo"},
|
||||
).add_to_hass(hass)
|
||||
MockConfigEntry(
|
||||
domain="comp",
|
||||
data={"vendor": "data"},
|
||||
options={"vendor": "options"},
|
||||
).add_to_hass(hass)
|
||||
|
||||
mock_setup_entry = AsyncMock(return_value=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user