Add type hints to integration tests (part 8) (#87982)

This commit is contained in:
epenet
2023-02-13 11:13:48 +01:00
committed by GitHub
parent 575f7c4205
commit 89e4ee5320
50 changed files with 696 additions and 339 deletions

View File

@@ -16,7 +16,9 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.setup import async_setup_component
from tests.common import async_mock_signal
from tests.common import MockUser, async_mock_signal
from tests.test_util.aiohttp import AiohttpClientMocker
from tests.typing import WebSocketGenerator
@pytest.fixture(autouse=True)
@@ -76,7 +78,9 @@ def mock_all(aioclient_mock):
)
async def test_ws_subscription(hassio_env, hass: HomeAssistant, hass_ws_client):
async def test_ws_subscription(
hassio_env, hass: HomeAssistant, hass_ws_client: WebSocketGenerator
) -> None:
"""Test websocket subscription."""
assert await async_setup_component(hass, "hassio", {})
client = await hass_ws_client(hass)
@@ -112,8 +116,11 @@ async def test_ws_subscription(hassio_env, hass: HomeAssistant, hass_ws_client):
async def test_websocket_supervisor_api(
hassio_env, hass: HomeAssistant, hass_ws_client, aioclient_mock
):
hassio_env,
hass: HomeAssistant,
hass_ws_client: WebSocketGenerator,
aioclient_mock: AiohttpClientMocker,
) -> None:
"""Test Supervisor websocket api."""
assert await async_setup_component(hass, "hassio", {})
websocket_client = await hass_ws_client(hass)
@@ -148,8 +155,11 @@ async def test_websocket_supervisor_api(
async def test_websocket_supervisor_api_error(
hassio_env, hass: HomeAssistant, hass_ws_client, aioclient_mock
):
hassio_env,
hass: HomeAssistant,
hass_ws_client: WebSocketGenerator,
aioclient_mock: AiohttpClientMocker,
) -> None:
"""Test Supervisor websocket api error."""
assert await async_setup_component(hass, "hassio", {})
websocket_client = await hass_ws_client(hass)
@@ -172,8 +182,12 @@ async def test_websocket_supervisor_api_error(
async def test_websocket_non_admin_user(
hassio_env, hass: HomeAssistant, hass_ws_client, aioclient_mock, hass_admin_user
):
hassio_env,
hass: HomeAssistant,
hass_ws_client: WebSocketGenerator,
aioclient_mock: AiohttpClientMocker,
hass_admin_user: MockUser,
) -> None:
"""Test Supervisor websocket api error."""
hass_admin_user.groups = []
assert await async_setup_component(hass, "hassio", {})