Add type hints to integration tests (part 15) (#88006)

This commit is contained in:
epenet 2023-02-15 10:00:49 +01:00 committed by GitHub
parent 6c23d6abfe
commit 50cbabb2d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 896 additions and 427 deletions

View file

@ -12,7 +12,8 @@ from homeassistant.components.netatmo.const import (
)
from homeassistant.components.netatmo.device_trigger import SUBTYPES
from homeassistant.const import ATTR_DEVICE_ID
from homeassistant.helpers import device_registry as dr
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.setup import async_setup_component
from tests.common import (
@ -40,8 +41,13 @@ def calls(hass):
],
)
async def test_get_triggers(
hass, device_registry, entity_registry, platform, device_type, event_types
):
hass: HomeAssistant,
device_registry: dr.DeviceRegistry,
entity_registry: er.EntityRegistry,
platform,
device_type,
event_types,
) -> None:
"""Test we get the expected triggers from a netatmo devices."""
config_entry = MockConfigEntry(domain=NETATMO_DOMAIN, data={})
config_entry.add_to_hass(hass)
@ -105,8 +111,14 @@ async def test_get_triggers(
],
)
async def test_if_fires_on_event(
hass, calls, device_registry, entity_registry, platform, camera_type, event_type
):
hass: HomeAssistant,
calls,
device_registry: dr.DeviceRegistry,
entity_registry: er.EntityRegistry,
platform,
camera_type,
event_type,
) -> None:
"""Test for event triggers firing."""
mac_address = "12:34:56:AB:CD:EF"
connection = (dr.CONNECTION_NETWORK_MAC, mac_address)
@ -180,15 +192,15 @@ async def test_if_fires_on_event(
],
)
async def test_if_fires_on_event_with_subtype(
hass,
hass: HomeAssistant,
calls,
device_registry,
entity_registry,
device_registry: dr.DeviceRegistry,
entity_registry: er.EntityRegistry,
platform,
camera_type,
event_type,
sub_type,
):
) -> None:
"""Test for event triggers firing."""
mac_address = "12:34:56:AB:CD:EF"
connection = (dr.CONNECTION_NETWORK_MAC, mac_address)
@ -258,8 +270,13 @@ async def test_if_fires_on_event_with_subtype(
[("climate", "NAPlug", trigger) for trigger in CLIMATE_TRIGGERS],
)
async def test_if_invalid_device(
hass, device_registry, entity_registry, platform, device_type, event_type
):
hass: HomeAssistant,
device_registry: dr.DeviceRegistry,
entity_registry: er.EntityRegistry,
platform,
device_type,
event_type,
) -> None:
"""Test for event triggers firing."""
mac_address = "12:34:56:AB:CD:EF"
connection = (dr.CONNECTION_NETWORK_MAC, mac_address)