Add type hints to integration tests (part 25) (#88308)

This commit is contained in:
epenet 2023-02-17 16:52:28 +01:00 committed by GitHub
parent aeb09678a8
commit 5b80b1f55a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 444 additions and 278 deletions

View file

@ -11,6 +11,8 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_entry_oauth2_flow
from tests.common import MockConfigEntry
from tests.test_util.aiohttp import AiohttpClientMocker
from tests.typing import ClientSessionGenerator
CLIENT_ID = "12345"
CLIENT_SECRET = "6789"
@ -26,7 +28,7 @@ async def test_abort_if_no_configuration(hass: HomeAssistant) -> None:
assert result["reason"] == "missing_credentials"
async def test_abort_if_existing_entry(hass: HomeAssistant):
async def test_abort_if_existing_entry(hass: HomeAssistant) -> None:
"""Check flow abort when an entry already exist."""
MockConfigEntry(domain=DOMAIN, unique_id=DOMAIN).add_to_hass(hass)
result = await hass.config_entries.flow.async_init(
@ -37,8 +39,11 @@ async def test_abort_if_existing_entry(hass: HomeAssistant):
async def test_full_flow(
hass, hass_client_no_auth, aioclient_mock, current_request_with_host
):
hass: HomeAssistant,
hass_client_no_auth: ClientSessionGenerator,
aioclient_mock: AiohttpClientMocker,
current_request_with_host: None,
) -> None:
"""Check full flow."""
assert await setup.async_setup_component(
hass,
@ -105,7 +110,9 @@ async def test_full_flow(
assert len(mock_setup.mock_calls) == 1
async def test_abort_if_authorization_timeout(hass, current_request_with_host):
async def test_abort_if_authorization_timeout(
hass: HomeAssistant, current_request_with_host: None
) -> None:
"""Check yolink authorization timeout."""
assert await setup.async_setup_component(
hass,
@ -131,8 +138,11 @@ async def test_abort_if_authorization_timeout(hass, current_request_with_host):
async def test_reauthentication(
hass, hass_client_no_auth, aioclient_mock, current_request_with_host
):
hass: HomeAssistant,
hass_client_no_auth: ClientSessionGenerator,
aioclient_mock: AiohttpClientMocker,
current_request_with_host: None,
) -> None:
"""Test yolink reauthentication."""
await setup.async_setup_component(
hass,