mirror of
https://github.com/home-assistant/core.git
synced 2025-11-11 20:10:12 +00:00
Add type hints to integration tests (part 8) (#87982)
This commit is contained in:
@@ -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", {})
|
||||
|
||||
Reference in New Issue
Block a user