Use real devices in wemo device trigger tests (#102699)

pull/102702/head^2
Erik Montnemery 2023-10-24 22:44:50 +02:00 committed by GitHub
parent 2807c9eaca
commit ee1007abdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -19,7 +19,6 @@ from homeassistant.setup import async_setup_component
from tests.common import async_get_device_automations, async_mock_service
MOCK_DEVICE_ID = "some-device-id"
DATA_MESSAGE = {"message": "service-called"}
@ -96,12 +95,12 @@ async def test_get_triggers(hass: HomeAssistant, wemo_entity) -> None:
assert triggers == unordered(expected_triggers)
async def test_fires_on_long_press(hass: HomeAssistant) -> None:
async def test_fires_on_long_press(hass: HomeAssistant, wemo_entity) -> None:
"""Test wemo long press trigger firing."""
assert await setup_automation(hass, MOCK_DEVICE_ID, EVENT_TYPE_LONG_PRESS)
assert await setup_automation(hass, wemo_entity.device_id, EVENT_TYPE_LONG_PRESS)
calls = async_mock_service(hass, "test", "automation")
message = {CONF_DEVICE_ID: MOCK_DEVICE_ID, CONF_TYPE: EVENT_TYPE_LONG_PRESS}
message = {CONF_DEVICE_ID: wemo_entity.device_id, CONF_TYPE: EVENT_TYPE_LONG_PRESS}
hass.bus.async_fire(WEMO_SUBSCRIPTION_EVENT, message)
await hass.async_block_till_done()
assert len(calls) == 1