Improve type hints in home_connect tests (#121014)

This commit is contained in:
epenet
2024-07-02 22:19:33 +02:00
committed by GitHub
parent bdc6805771
commit 476efb1d36
4 changed files with 16 additions and 22 deletions

View File

@@ -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]],