Improve typing for calls
fixture in tests (a-l) (#118349)
* Improve typing for `calls` fixture in tests (a-l) * More * More
This commit is contained in:
parent
89ae425ac2
commit
7e62061b9a
43 changed files with 546 additions and 338 deletions
|
@ -9,7 +9,7 @@ from homeassistant.components import automation
|
|||
from homeassistant.components.device_automation import DeviceAutomationType
|
||||
from homeassistant.components.light import DOMAIN
|
||||
from homeassistant.const import STATE_OFF, STATE_ON, EntityCategory
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.core import HomeAssistant, ServiceCall
|
||||
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
|
||||
|
@ -38,7 +38,7 @@ def stub_blueprint_populate_autouse(stub_blueprint_populate: None) -> None:
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def calls(hass):
|
||||
def calls(hass: HomeAssistant) -> list[ServiceCall]:
|
||||
"""Track calls to a mock service."""
|
||||
return async_mock_service(hass, "test", "automation")
|
||||
|
||||
|
@ -188,7 +188,7 @@ async def test_if_fires_on_state_change(
|
|||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
entity_registry: er.EntityRegistry,
|
||||
calls,
|
||||
calls: list[ServiceCall],
|
||||
enable_custom_integrations: None,
|
||||
) -> None:
|
||||
"""Test for turn_on and turn_off triggers firing."""
|
||||
|
@ -281,7 +281,7 @@ async def test_if_fires_on_state_change_legacy(
|
|||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
entity_registry: er.EntityRegistry,
|
||||
calls,
|
||||
calls: list[ServiceCall],
|
||||
enable_custom_integrations: None,
|
||||
) -> None:
|
||||
"""Test for turn_on and turn_off triggers firing."""
|
||||
|
@ -335,7 +335,7 @@ async def test_if_fires_on_state_change_with_for(
|
|||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
entity_registry: er.EntityRegistry,
|
||||
calls,
|
||||
calls: list[ServiceCall],
|
||||
enable_custom_integrations: None,
|
||||
) -> None:
|
||||
"""Test for triggers firing with delay."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue