Add type hints to integration tests (part 18) (#88174)
This commit is contained in:
parent
f465561536
commit
0a80ac19bc
47 changed files with 494 additions and 272 deletions
|
@ -7,7 +7,8 @@ import homeassistant.components.automation as automation
|
|||
from homeassistant.components.device_automation import DeviceAutomationType
|
||||
from homeassistant.components.remote import DOMAIN
|
||||
from homeassistant.const import CONF_PLATFORM, STATE_OFF, STATE_ON, EntityCategory
|
||||
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.helpers.entity_registry import RegistryEntryHider
|
||||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
@ -29,7 +30,11 @@ def calls(hass):
|
|||
return async_mock_service(hass, "test", "automation")
|
||||
|
||||
|
||||
async def test_get_triggers(hass, device_registry, entity_registry):
|
||||
async def test_get_triggers(
|
||||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
entity_registry: er.EntityRegistry,
|
||||
) -> None:
|
||||
"""Test we get the expected triggers from a remote."""
|
||||
config_entry = MockConfigEntry(domain="test", data={})
|
||||
config_entry.add_to_hass(hass)
|
||||
|
@ -67,12 +72,12 @@ async def test_get_triggers(hass, device_registry, entity_registry):
|
|||
),
|
||||
)
|
||||
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)
|
||||
|
@ -105,7 +110,11 @@ async def test_get_triggers_hidden_auxiliary(
|
|||
assert_lists_same(triggers, expected_triggers)
|
||||
|
||||
|
||||
async def test_get_trigger_capabilities(hass, device_registry, entity_registry):
|
||||
async def test_get_trigger_capabilities(
|
||||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
entity_registry: er.EntityRegistry,
|
||||
) -> None:
|
||||
"""Test we get the expected capabilities from a remote trigger."""
|
||||
config_entry = MockConfigEntry(domain="test", data={})
|
||||
config_entry.add_to_hass(hass)
|
||||
|
@ -131,7 +140,9 @@ async def test_get_trigger_capabilities(hass, device_registry, entity_registry):
|
|||
assert capabilities == expected_capabilities
|
||||
|
||||
|
||||
async def test_if_fires_on_state_change(hass, calls, enable_custom_integrations):
|
||||
async def test_if_fires_on_state_change(
|
||||
hass: HomeAssistant, calls, enable_custom_integrations: None
|
||||
) -> None:
|
||||
"""Test for turn_on and turn_off triggers firing."""
|
||||
platform = getattr(hass.components, f"test.{DOMAIN}")
|
||||
|
||||
|
@ -243,8 +254,8 @@ async def test_if_fires_on_state_change(hass, calls, enable_custom_integrations)
|
|||
|
||||
|
||||
async def test_if_fires_on_state_change_with_for(
|
||||
hass, calls, enable_custom_integrations
|
||||
):
|
||||
hass: HomeAssistant, calls, enable_custom_integrations: None
|
||||
) -> None:
|
||||
"""Test for triggers firing with delay."""
|
||||
platform = getattr(hass.components, f"test.{DOMAIN}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue