mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 03:08:01 +02:00
Update test
This commit is contained in:
@ -2251,15 +2251,15 @@ async def test_trigger(hass: HomeAssistant) -> None:
|
|||||||
assert test(hass, {"trigger": {"id": "123456"}})
|
assert test(hass, {"trigger": {"id": "123456"}})
|
||||||
|
|
||||||
|
|
||||||
async def test_platform_async_validate_condition_config(hass: HomeAssistant) -> None:
|
async def test_platform_async_get_conditions(hass: HomeAssistant) -> None:
|
||||||
"""Test platform.async_validate_condition_config will be called if it exists."""
|
"""Test platform.async_get_conditions will be called if it exists."""
|
||||||
config = {CONF_DEVICE_ID: "test", CONF_DOMAIN: "test", CONF_CONDITION: "device"}
|
config = {CONF_DEVICE_ID: "test", CONF_DOMAIN: "test", CONF_CONDITION: "device"}
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.device_automation.condition.async_validate_condition_config",
|
"homeassistant.components.device_automation.condition.async_get_conditions",
|
||||||
AsyncMock(),
|
AsyncMock(return_value={"device": AsyncMock()}),
|
||||||
) as device_automation_validate_condition_mock:
|
) as device_automation_async_get_conditions_mock:
|
||||||
await condition.async_validate_condition_config(hass, config)
|
await condition.async_validate_condition_config(hass, config)
|
||||||
device_automation_validate_condition_mock.assert_awaited()
|
device_automation_async_get_conditions_mock.assert_awaited()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("enabled_value", [True, "{{ 1 == 1 }}"])
|
@pytest.mark.parametrize("enabled_value", [True, "{{ 1 == 1 }}"])
|
||||||
|
Reference in New Issue
Block a user