Add type hints to integration tests (part 9) (#87983)

This commit is contained in:
epenet
2023-02-13 12:06:51 +01:00
committed by GitHub
parent 6359775cfc
commit 03710e58b5
63 changed files with 1526 additions and 781 deletions

View File

@@ -1,5 +1,4 @@
"""Basic checks for HomeKitSwitch."""
from aiohomekit.model.characteristics import (
CharacteristicsTypes,
InUseValues,
@@ -7,6 +6,7 @@ from aiohomekit.model.characteristics import (
)
from aiohomekit.model.services import ServicesTypes
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from .common import get_next_aid, setup_test_component
@@ -49,7 +49,7 @@ def create_char_switch_service(accessory):
on_char.value = False
async def test_switch_change_outlet_state(hass, utcnow):
async def test_switch_change_outlet_state(hass: HomeAssistant, utcnow) -> None:
"""Test that we can turn a HomeKit outlet on and off again."""
helper = await setup_test_component(hass, create_switch_service)
@@ -74,7 +74,7 @@ async def test_switch_change_outlet_state(hass, utcnow):
)
async def test_switch_read_outlet_state(hass, utcnow):
async def test_switch_read_outlet_state(hass: HomeAssistant, utcnow) -> None:
"""Test that we can read the state of a HomeKit outlet accessory."""
helper = await setup_test_component(hass, create_switch_service)
@@ -107,7 +107,7 @@ async def test_switch_read_outlet_state(hass, utcnow):
assert switch_1.attributes["outlet_in_use"] is True
async def test_valve_change_active_state(hass, utcnow):
async def test_valve_change_active_state(hass: HomeAssistant, utcnow) -> None:
"""Test that we can turn a valve on and off again."""
helper = await setup_test_component(hass, create_valve_service)
@@ -132,7 +132,7 @@ async def test_valve_change_active_state(hass, utcnow):
)
async def test_valve_read_state(hass, utcnow):
async def test_valve_read_state(hass: HomeAssistant, utcnow) -> None:
"""Test that we can read the state of a valve accessory."""
helper = await setup_test_component(hass, create_valve_service)
@@ -165,7 +165,7 @@ async def test_valve_read_state(hass, utcnow):
assert switch_1.attributes["in_use"] is False
async def test_char_switch_change_state(hass, utcnow):
async def test_char_switch_change_state(hass: HomeAssistant, utcnow) -> None:
"""Test that we can turn a characteristic on and off again."""
helper = await setup_test_component(
hass, create_char_switch_service, suffix="pairing_mode"
@@ -198,7 +198,7 @@ async def test_char_switch_change_state(hass, utcnow):
)
async def test_char_switch_read_state(hass, utcnow):
async def test_char_switch_read_state(hass: HomeAssistant, utcnow) -> None:
"""Test that we can read the state of a HomeKit characteristic switch."""
helper = await setup_test_component(
hass, create_char_switch_service, suffix="pairing_mode"
@@ -219,7 +219,7 @@ async def test_char_switch_read_state(hass, utcnow):
assert switch_1.state == "off"
async def test_migrate_unique_id(hass, utcnow):
async def test_migrate_unique_id(hass: HomeAssistant, utcnow) -> None:
"""Test a we can migrate a switch unique id."""
entity_registry = er.async_get(hass)
aid = get_next_aid()