Add type hints to integration tests (part 23) (#88235)

This commit is contained in:
epenet 2023-02-17 16:40:46 +01:00 committed by GitHub
parent aa50096a31
commit 9a5f88f55f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 651 additions and 408 deletions

View file

@ -8,9 +8,7 @@ from homeassistant.components.device_automation import DeviceAutomationType
from homeassistant.components.update import DOMAIN
from homeassistant.const import CONF_PLATFORM, STATE_OFF, STATE_ON, EntityCategory
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.device_registry import DeviceRegistry
from homeassistant.helpers.entity_registry import EntityRegistry, RegistryEntryHider
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
@ -33,8 +31,8 @@ def calls(hass: HomeAssistant) -> list[ServiceCall]:
async def test_get_triggers(
hass: HomeAssistant,
device_registry: DeviceRegistry,
entity_registry: EntityRegistry,
device_registry: dr.DeviceRegistry,
entity_registry: er.EntityRegistry,
) -> None:
"""Test we get the expected triggers from a update entity."""
config_entry = MockConfigEntry(domain="test", data={})
@ -66,19 +64,19 @@ async def test_get_triggers(
@pytest.mark.parametrize(
("hidden_by", "entity_category"),
(
(RegistryEntryHider.INTEGRATION, None),
(RegistryEntryHider.USER, None),
(er.RegistryEntryHider.INTEGRATION, None),
(er.RegistryEntryHider.USER, None),
(None, EntityCategory.CONFIG),
(None, EntityCategory.DIAGNOSTIC),
),
)
async def test_get_triggers_hidden_auxiliary(
hass,
device_registry,
entity_registry,
hass: HomeAssistant,
device_registry: dr.DeviceRegistry,
entity_registry: er.EntityRegistry,
hidden_by,
entity_category,
):
) -> None:
"""Test we get the expected triggers from a hidden or auxiliary entity."""
config_entry = MockConfigEntry(domain="test", data={})
config_entry.add_to_hass(hass)
@ -113,8 +111,8 @@ async def test_get_triggers_hidden_auxiliary(
async def test_get_trigger_capabilities(
hass: HomeAssistant,
device_registry: DeviceRegistry,
entity_registry: EntityRegistry,
device_registry: dr.DeviceRegistry,
entity_registry: er.EntityRegistry,
) -> None:
"""Test we get the expected capabilities from a update trigger."""
config_entry = MockConfigEntry(domain="test", data={})