mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Add missing type hints to tests (#90218)
* Add type hints to tests * Revert gree as handled in #90222
This commit is contained in:
parent
7f1fff12ef
commit
5f3868b141
@ -668,7 +668,7 @@ async def test_trigger_timestamp_window_edge(
|
|||||||
|
|
||||||
|
|
||||||
async def test_event_start_trigger_dst(
|
async def test_event_start_trigger_dst(
|
||||||
hass: HomeAssistant, calls, fake_schedule, freezer
|
hass: HomeAssistant, calls, fake_schedule, freezer: FrozenDateTimeFactory
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test a calendar event trigger happening at the start of daylight savings time."""
|
"""Test a calendar event trigger happening at the start of daylight savings time."""
|
||||||
tzinfo = zoneinfo.ZoneInfo("America/Los_Angeles")
|
tzinfo = zoneinfo.ZoneInfo("America/Los_Angeles")
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
"""Tests for diagnostics platform of local calendar."""
|
"""Tests for diagnostics platform of local calendar."""
|
||||||
|
|
||||||
from aiohttp.test_utils import TestClient
|
from aiohttp.test_utils import TestClient
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
import pytest
|
import pytest
|
||||||
@ -9,11 +8,11 @@ from homeassistant.auth.models import Credentials
|
|||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from .conftest import TEST_ENTITY, Client, ClientFixture
|
from .conftest import TEST_ENTITY, Client
|
||||||
|
|
||||||
from tests.common import CLIENT_ID, MockConfigEntry, MockUser
|
from tests.common import CLIENT_ID, MockConfigEntry, MockUser
|
||||||
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
||||||
from tests.typing import ClientSessionGenerator
|
from tests.typing import ClientSessionGenerator, WebSocketGenerator
|
||||||
|
|
||||||
|
|
||||||
async def generate_new_hass_access_token(
|
async def generate_new_hass_access_token(
|
||||||
@ -82,7 +81,7 @@ async def test_api_date_time_event(
|
|||||||
hass_admin_user: MockUser,
|
hass_admin_user: MockUser,
|
||||||
hass_admin_credential: Credentials,
|
hass_admin_credential: Credentials,
|
||||||
config_entry: MockConfigEntry,
|
config_entry: MockConfigEntry,
|
||||||
hass_ws_client: ClientFixture,
|
hass_ws_client: WebSocketGenerator,
|
||||||
aiohttp_client: ClientSessionGenerator,
|
aiohttp_client: ClientSessionGenerator,
|
||||||
socket_enabled: None,
|
socket_enabled: None,
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
|
@ -7,6 +7,7 @@ import zigpy.state
|
|||||||
from homeassistant.components import zha
|
from homeassistant.components import zha
|
||||||
from homeassistant.components.zha import api
|
from homeassistant.components.zha import api
|
||||||
from homeassistant.components.zha.core.const import RadioType
|
from homeassistant.components.zha.core.const import RadioType
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
@ -16,7 +17,9 @@ def required_platform_only():
|
|||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
async def test_async_get_network_settings_active(hass, setup_zha):
|
async def test_async_get_network_settings_active(
|
||||||
|
hass: HomeAssistant, setup_zha
|
||||||
|
) -> None:
|
||||||
"""Test reading settings with an active ZHA installation."""
|
"""Test reading settings with an active ZHA installation."""
|
||||||
await setup_zha()
|
await setup_zha()
|
||||||
|
|
||||||
@ -25,8 +28,8 @@ async def test_async_get_network_settings_active(hass, setup_zha):
|
|||||||
|
|
||||||
|
|
||||||
async def test_async_get_network_settings_inactive(
|
async def test_async_get_network_settings_inactive(
|
||||||
hass, setup_zha, zigpy_app_controller
|
hass: HomeAssistant, setup_zha, zigpy_app_controller
|
||||||
):
|
) -> None:
|
||||||
"""Test reading settings with an inactive ZHA installation."""
|
"""Test reading settings with an inactive ZHA installation."""
|
||||||
await setup_zha()
|
await setup_zha()
|
||||||
|
|
||||||
@ -48,8 +51,8 @@ async def test_async_get_network_settings_inactive(
|
|||||||
|
|
||||||
|
|
||||||
async def test_async_get_network_settings_missing(
|
async def test_async_get_network_settings_missing(
|
||||||
hass, setup_zha, zigpy_app_controller
|
hass: HomeAssistant, setup_zha, zigpy_app_controller
|
||||||
):
|
) -> None:
|
||||||
"""Test reading settings with an inactive ZHA installation, no valid channel."""
|
"""Test reading settings with an inactive ZHA installation, no valid channel."""
|
||||||
await setup_zha()
|
await setup_zha()
|
||||||
|
|
||||||
@ -69,13 +72,13 @@ async def test_async_get_network_settings_missing(
|
|||||||
assert settings is None
|
assert settings is None
|
||||||
|
|
||||||
|
|
||||||
async def test_async_get_network_settings_failure(hass):
|
async def test_async_get_network_settings_failure(hass: HomeAssistant) -> None:
|
||||||
"""Test reading settings with no ZHA config entries and no database."""
|
"""Test reading settings with no ZHA config entries and no database."""
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
await api.async_get_network_settings(hass)
|
await api.async_get_network_settings(hass)
|
||||||
|
|
||||||
|
|
||||||
async def test_async_get_radio_type_active(hass, setup_zha):
|
async def test_async_get_radio_type_active(hass: HomeAssistant, setup_zha) -> None:
|
||||||
"""Test reading the radio type with an active ZHA installation."""
|
"""Test reading the radio type with an active ZHA installation."""
|
||||||
await setup_zha()
|
await setup_zha()
|
||||||
|
|
||||||
@ -83,7 +86,7 @@ async def test_async_get_radio_type_active(hass, setup_zha):
|
|||||||
assert radio_type == RadioType.ezsp
|
assert radio_type == RadioType.ezsp
|
||||||
|
|
||||||
|
|
||||||
async def test_async_get_radio_path_active(hass, setup_zha):
|
async def test_async_get_radio_path_active(hass: HomeAssistant, setup_zha) -> None:
|
||||||
"""Test reading the radio path with an active ZHA installation."""
|
"""Test reading the radio path with an active ZHA installation."""
|
||||||
await setup_zha()
|
await setup_zha()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user