From 2f0cfc8b61cf647edf70156432c06576bfc717fa Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Mon, 25 Mar 2024 23:39:31 +0100 Subject: [PATCH] Remove deprecated `hass.components` from system_health tests (#114207) --- tests/components/system_health/test_init.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/components/system_health/test_init.py b/tests/components/system_health/test_init.py index 0767d9c3ff1..e677b7d1d34 100644 --- a/tests/components/system_health/test_init.py +++ b/tests/components/system_health/test_init.py @@ -5,6 +5,7 @@ from unittest.mock import AsyncMock, Mock, patch from aiohttp.client_exceptions import ClientError from homeassistant.components import system_health +from homeassistant.components.system_health import async_register_info from homeassistant.core import HomeAssistant from homeassistant.setup import async_setup_component @@ -74,7 +75,7 @@ async def test_info_endpoint_register_callback( async def mock_info(hass): return {"storage": "YAML"} - hass.components.system_health.async_register_info("lovelace", mock_info) + async_register_info(hass, "lovelace", mock_info) assert await async_setup_component(hass, "system_health", {}) data = await gather_system_health_info(hass, hass_ws_client) @@ -94,7 +95,7 @@ async def test_info_endpoint_register_callback_timeout( async def mock_info(hass): raise TimeoutError - hass.components.system_health.async_register_info("lovelace", mock_info) + async_register_info(hass, "lovelace", mock_info) assert await async_setup_component(hass, "system_health", {}) data = await gather_system_health_info(hass, hass_ws_client) @@ -111,7 +112,7 @@ async def test_info_endpoint_register_callback_exc( async def mock_info(hass): raise Exception("TEST ERROR") - hass.components.system_health.async_register_info("lovelace", mock_info) + async_register_info(hass, "lovelace", mock_info) assert await async_setup_component(hass, "system_health", {}) data = await gather_system_health_info(hass, hass_ws_client)