mirror of
https://github.com/home-assistant/core.git
synced 2025-11-13 04:50:17 +00:00
Improve type hints in home_connect tests (#121014)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Test the integration init functionality."""
|
||||
|
||||
from collections.abc import Awaitable, Callable, Generator
|
||||
from collections.abc import Awaitable, Callable
|
||||
from typing import Any
|
||||
from unittest.mock import MagicMock, Mock
|
||||
|
||||
@@ -117,8 +117,8 @@ SERVICE_APPLIANCE_METHOD_MAPPING = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("bypass_throttle")
|
||||
async def test_api_setup(
|
||||
bypass_throttle: Generator[None, Any, None],
|
||||
hass: HomeAssistant,
|
||||
config_entry: MockConfigEntry,
|
||||
integration_setup: Callable[[], Awaitable[bool]],
|
||||
@@ -137,9 +137,8 @@ async def test_api_setup(
|
||||
assert config_entry.state == ConfigEntryState.NOT_LOADED
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("bypass_throttle")
|
||||
async def test_exception_handling(
|
||||
bypass_throttle: Generator[None, Any, None],
|
||||
hass: HomeAssistant,
|
||||
integration_setup: Callable[[], Awaitable[bool]],
|
||||
config_entry: MockConfigEntry,
|
||||
setup_credentials: None,
|
||||
@@ -154,8 +153,8 @@ async def test_exception_handling(
|
||||
|
||||
|
||||
@pytest.mark.parametrize("token_expiration_time", [12345])
|
||||
@pytest.mark.usefixtures("bypass_throttle")
|
||||
async def test_token_refresh_success(
|
||||
bypass_throttle: Generator[None, Any, None],
|
||||
integration_setup: Callable[[], Awaitable[bool]],
|
||||
config_entry: MockConfigEntry,
|
||||
aioclient_mock: AiohttpClientMocker,
|
||||
@@ -227,9 +226,8 @@ async def test_update_throttle(
|
||||
assert get_appliances.call_count == 0
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("bypass_throttle")
|
||||
async def test_http_error(
|
||||
bypass_throttle: Generator[None, Any, None],
|
||||
hass: HomeAssistant,
|
||||
config_entry: MockConfigEntry,
|
||||
integration_setup: Callable[[], Awaitable[bool]],
|
||||
setup_credentials: None,
|
||||
@@ -247,9 +245,9 @@ async def test_http_error(
|
||||
"service_call",
|
||||
SERVICE_KV_CALL_PARAMS + SERVICE_COMMAND_CALL_PARAMS + SERVICE_PROGRAM_CALL_PARAMS,
|
||||
)
|
||||
@pytest.mark.usefixtures("bypass_throttle")
|
||||
async def test_services(
|
||||
service_call: list[dict[str, Any]],
|
||||
bypass_throttle: Generator[None, Any, None],
|
||||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
config_entry: MockConfigEntry,
|
||||
@@ -279,8 +277,8 @@ async def test_services(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("bypass_throttle")
|
||||
async def test_services_exception(
|
||||
bypass_throttle: Generator[None, Any, None],
|
||||
hass: HomeAssistant,
|
||||
config_entry: MockConfigEntry,
|
||||
integration_setup: Callable[[], Awaitable[bool]],
|
||||
|
||||
Reference in New Issue
Block a user