Fix device condition scaffold (#27300)

This commit is contained in:
Erik Montnemery 2019-10-08 05:10:21 +02:00 committed by Paulus Schoutsen
parent c9e26b6fd0
commit c72ac87c73
2 changed files with 30 additions and 12 deletions

View file

@ -1,7 +1,7 @@
"""The tests for NEW_NAME device conditions."""
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_conditions(hass, device_reg, entity_reg):
"""Test we get the expected conditions from a switch."""
"""Test we get the expected conditions 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_conditions(hass, device_reg, entity_reg):
},
]
conditions = await async_get_device_automations(hass, "condition", device_entry.id)
assert conditions == expected_conditions
assert_lists_same(conditions, expected_conditions)
async def test_if_state(hass, calls):