Improve device automation validation (#86143)
This commit is contained in:
parent
0c8b6c13fc
commit
1e2f00e186
9 changed files with 255 additions and 116 deletions
|
@ -4633,14 +4633,12 @@ async def test_breakpoints_2(hass):
|
|||
async def test_platform_async_validate_action_config(hass):
|
||||
"""Test platform.async_validate_action_config will be called if it exists."""
|
||||
config = {CONF_DEVICE_ID: "test", CONF_DOMAIN: "test"}
|
||||
platform = AsyncMock()
|
||||
with patch(
|
||||
"homeassistant.components.device_automation.action.async_get_device_automation_platform",
|
||||
return_value=platform,
|
||||
):
|
||||
platform.async_validate_action_config.return_value = config
|
||||
"homeassistant.components.device_automation.action.async_validate_action_config",
|
||||
return_value=AsyncMock(),
|
||||
) as device_automation_validate_action_mock:
|
||||
await script.async_validate_action_config(hass, config)
|
||||
platform.async_validate_action_config.assert_awaited()
|
||||
device_automation_validate_action_mock.assert_awaited()
|
||||
|
||||
|
||||
async def test_stop_action(hass, caplog):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue