Add type hints to integration tests (part 13) (#87998)

This commit is contained in:
epenet 2023-02-13 14:38:37 +01:00 committed by GitHub
parent c557cd2b1e
commit ea11a30a35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 798 additions and 404 deletions

View file

@ -3,10 +3,16 @@ import logging
from homeassistant.components.logger.helpers import async_get_domain_config
from homeassistant.components.websocket_api import const
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from tests.common import MockUser
from tests.typing import WebSocketGenerator
async def test_integration_log_info(hass, hass_ws_client, hass_admin_user):
async def test_integration_log_info(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator, hass_admin_user: MockUser
) -> None:
"""Test fetching integration log info."""
assert await async_setup_component(hass, "logger", {})
@ -26,8 +32,8 @@ async def test_integration_log_info(hass, hass_ws_client, hass_admin_user):
async def test_integration_log_level_logger_not_loaded(
hass, hass_ws_client, hass_admin_user
):
hass: HomeAssistant, hass_ws_client: WebSocketGenerator, hass_admin_user: MockUser
) -> None:
"""Test setting integration log level."""
websocket_client = await hass_ws_client()
await websocket_client.send_json(
@ -46,7 +52,9 @@ async def test_integration_log_level_logger_not_loaded(
assert not msg["success"]
async def test_integration_log_level(hass, hass_ws_client, hass_admin_user):
async def test_integration_log_level(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator, hass_admin_user: MockUser
) -> None:
"""Test setting integration log level."""
websocket_client = await hass_ws_client()
assert await async_setup_component(hass, "logger", {})
@ -72,8 +80,8 @@ async def test_integration_log_level(hass, hass_ws_client, hass_admin_user):
async def test_integration_log_level_unknown_integration(
hass, hass_ws_client, hass_admin_user
):
hass: HomeAssistant, hass_ws_client: WebSocketGenerator, hass_admin_user: MockUser
) -> None:
"""Test setting integration log level for an unknown integration."""
websocket_client = await hass_ws_client()
assert await async_setup_component(hass, "logger", {})
@ -94,7 +102,9 @@ async def test_integration_log_level_unknown_integration(
assert not msg["success"]
async def test_module_log_level(hass, hass_ws_client, hass_admin_user):
async def test_module_log_level(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator, hass_admin_user: MockUser
) -> None:
"""Test setting integration log level."""
websocket_client = await hass_ws_client()
assert await async_setup_component(
@ -124,7 +134,9 @@ async def test_module_log_level(hass, hass_ws_client, hass_admin_user):
}
async def test_module_log_level_override(hass, hass_ws_client, hass_admin_user):
async def test_module_log_level_override(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator, hass_admin_user: MockUser
) -> None:
"""Test override yaml integration log level."""
websocket_client = await hass_ws_client()
assert await async_setup_component(