Validate generated device actions (#27262)

* Validate generated actions

* Use hass.services.async_call instead of service.async_call_from_config
This commit is contained in:
Erik Montnemery
2019-10-08 10:06:17 -07:00
committed by Paulus Schoutsen
parent 1a9d07dbdc
commit 0ba4ee1398
3 changed files with 12 additions and 16 deletions
@@ -8,6 +8,7 @@ from homeassistant.helpers import device_registry
from tests.common import (
MockConfigEntry,
assert_lists_same,
async_mock_service,
mock_device_registry,
mock_registry,
@@ -28,7 +29,7 @@ def entity_reg(hass):
async def test_get_actions(hass, device_reg, entity_reg):
"""Test we get the expected actions from a switch."""
"""Test we get the expected actions from a NEW_DOMAIN."""
config_entry = MockConfigEntry(domain="test", data={})
config_entry.add_to_hass(hass)
device_entry = device_reg.async_get_or_create(
@@ -51,7 +52,7 @@ async def test_get_actions(hass, device_reg, entity_reg):
},
]
actions = await async_get_device_automations(hass, "action", device_entry.id)
assert actions == expected_actions
assert_lists_same(actions, expected_actions)
async def test_action(hass):