Remove deprecated hass.components
from system_health tests (#114207)
This commit is contained in:
parent
18174ad47d
commit
2f0cfc8b61
1 changed files with 4 additions and 3 deletions
|
@ -5,6 +5,7 @@ from unittest.mock import AsyncMock, Mock, patch
|
||||||
from aiohttp.client_exceptions import ClientError
|
from aiohttp.client_exceptions import ClientError
|
||||||
|
|
||||||
from homeassistant.components import system_health
|
from homeassistant.components import system_health
|
||||||
|
from homeassistant.components.system_health import async_register_info
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
|
@ -74,7 +75,7 @@ async def test_info_endpoint_register_callback(
|
||||||
async def mock_info(hass):
|
async def mock_info(hass):
|
||||||
return {"storage": "YAML"}
|
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", {})
|
assert await async_setup_component(hass, "system_health", {})
|
||||||
data = await gather_system_health_info(hass, hass_ws_client)
|
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):
|
async def mock_info(hass):
|
||||||
raise TimeoutError
|
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", {})
|
assert await async_setup_component(hass, "system_health", {})
|
||||||
data = await gather_system_health_info(hass, hass_ws_client)
|
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):
|
async def mock_info(hass):
|
||||||
raise Exception("TEST ERROR")
|
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", {})
|
assert await async_setup_component(hass, "system_health", {})
|
||||||
data = await gather_system_health_info(hass, hass_ws_client)
|
data = await gather_system_health_info(hass, hass_ws_client)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue