Validate generated device triggers (#27264)

* Validate generated trigger

* Update scaffold
This commit is contained in:
Erik Montnemery authored and Paulus Schoutsen committed 2019-10-07 13:09:48 -07:00
1 parent 6565c17828
commit dabdf8b577
7 files changed
+41 -25

No files matched your search

@@ -1,7 +1,7 @@
"""The tests for NEW_NAME device triggers."""
import pytest
from homeassistant.components.switch import DOMAIN
from homeassistant.components.NEW_DOMAIN import DOMAIN
from homeassistant.const import STATE_ON, STATE_OFF
from homeassistant.setup import async_setup_component
import homeassistant.components.automation as automation
@@ -9,6 +9,7 @@ from homeassistant.helpers import device_registry
from tests.common import (
MockConfigEntry,
assert_lists_same,
async_mock_service,
mock_device_registry,
mock_registry,
@@ -35,7 +36,7 @@ def calls(hass):
async def test_get_triggers(hass, device_reg, entity_reg):
"""Test we get the expected triggers from a switch."""
"""Test we get the expected triggers from a NEW_DOMAIN."""
config_entry = MockConfigEntry(domain="test", data={})
config_entry.add_to_hass(hass)
device_entry = device_reg.async_get_or_create(
@@ -60,7 +61,7 @@ async def test_get_triggers(hass, device_reg, entity_reg):
},
]
triggers = await async_get_device_automations(hass, "trigger", device_entry.id)
assert triggers == expected_triggers
assert_lists_same(triggers, expected_triggers)
async def test_if_fires_on_state_change(hass, calls):