1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Add type hints to integration tests (h-i) (#87703)

This commit is contained in:
epenet
2023-02-08 18:12:56 +01:00
committed by GitHub
parent 807c69f621
commit 37a2040d7b
91 changed files with 674 additions and 425 deletions

View File

@@ -2,6 +2,7 @@
from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import ServicesTypes
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from .common import Helper, get_next_aid, setup_test_component
@@ -37,7 +38,7 @@ def create_switch_with_ecobee_clear_hold_button(accessory):
return service
async def test_press_button(hass):
async def test_press_button(hass: HomeAssistant) -> None:
"""Test a switch service that has a button characteristic is correctly handled."""
helper = await setup_test_component(hass, create_switch_with_setup_button)
@@ -64,7 +65,7 @@ async def test_press_button(hass):
)
async def test_ecobee_clear_hold_press_button(hass):
async def test_ecobee_clear_hold_press_button(hass: HomeAssistant) -> None:
"""Test ecobee clear hold button characteristic is correctly handled."""
helper = await setup_test_component(
hass, create_switch_with_ecobee_clear_hold_button

View File

@@ -1,5 +1,4 @@
"""Tests for homekit_controller init."""
from datetime import timedelta
from unittest.mock import patch
@@ -26,6 +25,7 @@ from .common import (
)
from tests.common import async_fire_time_changed
from tests.typing import WebSocketGenerator
ALIVE_DEVICE_NAME = "testdevice"
ALIVE_DEVICE_ENTITY_ID = "light.testdevice"
@@ -75,7 +75,9 @@ def create_alive_service(accessory):
return service
async def test_device_remove_devices(hass, hass_ws_client):
async def test_device_remove_devices(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator
) -> None:
"""Test we can only remove a device that no longer exists."""
assert await async_setup_component(hass, "config", {})
helper: Helper = await setup_test_component(hass, create_alive_service)

View File

@@ -4,6 +4,7 @@ from aiohomekit.model.services import ServicesTypes
from homeassistant.components.homekit_controller.const import ENTITY_MAP
from homeassistant.components.homekit_controller.storage import EntityMapStorage
from homeassistant.core import HomeAssistant
from .common import setup_platform, setup_test_component
@@ -42,7 +43,7 @@ async def test_storage_is_removed(hass, hass_storage):
assert hass_storage[ENTITY_MAP]["data"]["pairings"] == {}
async def test_storage_is_removed_idempotent(hass):
async def test_storage_is_removed_idempotent(hass: HomeAssistant) -> None:
"""Test entity map storage removal is idempotent."""
await setup_platform(hass)