Add supervisor key to homassistant_alerts (#82862)
This commit is contained in:
parent
4ab6f97341
commit
10e7d6e04d
6 changed files with 63 additions and 8 deletions
|
@ -36,13 +36,15 @@ async def setup_repairs(hass):
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ha_version, expected_alerts",
|
||||
"ha_version, supervisor_info, expected_alerts",
|
||||
(
|
||||
(
|
||||
"2022.7.0",
|
||||
{"version": "2022.11.0"},
|
||||
[
|
||||
("aladdin_connect.markdown", "aladdin_connect"),
|
||||
("dark_sky.markdown", "darksky"),
|
||||
("hassio.markdown", "hassio"),
|
||||
("hikvision.markdown", "hikvision"),
|
||||
("hikvision.markdown", "hikvisioncam"),
|
||||
("hive_us.markdown", "hive"),
|
||||
|
@ -56,6 +58,7 @@ async def setup_repairs(hass):
|
|||
),
|
||||
(
|
||||
"2022.8.0",
|
||||
{"version": "2022.11.1"},
|
||||
[
|
||||
("dark_sky.markdown", "darksky"),
|
||||
("hikvision.markdown", "hikvision"),
|
||||
|
@ -71,6 +74,7 @@ async def setup_repairs(hass):
|
|||
),
|
||||
(
|
||||
"2021.10.0",
|
||||
None,
|
||||
[
|
||||
("aladdin_connect.markdown", "aladdin_connect"),
|
||||
("dark_sky.markdown", "darksky"),
|
||||
|
@ -91,6 +95,7 @@ async def test_alerts(
|
|||
hass_ws_client,
|
||||
aioclient_mock: AiohttpClientMocker,
|
||||
ha_version,
|
||||
supervisor_info,
|
||||
expected_alerts,
|
||||
) -> None:
|
||||
"""Test creating issues based on alerts."""
|
||||
|
@ -119,9 +124,18 @@ async def test_alerts(
|
|||
for domain in activated_components:
|
||||
hass.config.components.add(domain)
|
||||
|
||||
if supervisor_info is not None:
|
||||
hass.config.components.add("hassio")
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.homeassistant_alerts.__version__",
|
||||
ha_version,
|
||||
), patch(
|
||||
"homeassistant.components.homeassistant_alerts.is_hassio",
|
||||
return_value=supervisor_info is not None,
|
||||
), patch(
|
||||
"homeassistant.components.homeassistant_alerts.get_supervisor_info",
|
||||
return_value=supervisor_info,
|
||||
):
|
||||
assert await async_setup_component(hass, DOMAIN, {})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue