From 88583149ea3bf0b8f10d37d56604a0eb84b2e7bd Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:33:31 +0200 Subject: [PATCH] Use service_calls fixture in deconz tests (#120905) --- tests/components/deconz/test_device_trigger.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/components/deconz/test_device_trigger.py b/tests/components/deconz/test_device_trigger.py index 54b735ba021..5f17da89a4b 100644 --- a/tests/components/deconz/test_device_trigger.py +++ b/tests/components/deconz/test_device_trigger.py @@ -34,7 +34,7 @@ from homeassistant.setup import async_setup_component from .test_gateway import DECONZ_WEB_REQUEST, setup_deconz_integration -from tests.common import async_get_device_automations, async_mock_service +from tests.common import async_get_device_automations from tests.test_util.aiohttp import AiohttpClientMocker @@ -43,12 +43,6 @@ def stub_blueprint_populate_autouse(stub_blueprint_populate: None) -> None: """Stub copying the blueprints to the config folder.""" -@pytest.fixture -def automation_calls(hass: HomeAssistant) -> list[ServiceCall]: - """Track automation calls to a mock service.""" - return async_mock_service(hass, "test", "automation") - - async def test_get_triggers( hass: HomeAssistant, device_registry: dr.DeviceRegistry, @@ -300,7 +294,7 @@ async def test_functional_device_trigger( hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, mock_deconz_websocket, - automation_calls: list[ServiceCall], + service_calls: list[ServiceCall], device_registry: dr.DeviceRegistry, ) -> None: """Test proper matching and attachment of device trigger automation.""" @@ -369,8 +363,8 @@ async def test_functional_device_trigger( await mock_deconz_websocket(data=event_changed_sensor) await hass.async_block_till_done() - assert len(automation_calls) == 1 - assert automation_calls[0].data["some"] == "test_trigger_button_press" + assert len(service_calls) == 1 + assert service_calls[0].data["some"] == "test_trigger_button_press" @pytest.mark.skip(reason="Temporarily disabled until automation validation is improved")