mirror of
https://github.com/elisspace/core.git
synced 2026-08-30 08:02:02 +00:00
Adjust tests
This commit is contained in:
@@ -140,6 +140,13 @@ async def test_websocket_get_triggers(hass, hass_ws_client, device_reg, entity_r
|
||||
)
|
||||
entity_reg.async_get_or_create("light", "test", "5678", device_id=device_entry.id)
|
||||
expected_triggers = [
|
||||
{
|
||||
"platform": "device",
|
||||
"domain": "light",
|
||||
"type": "toggled",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": "light.test_5678",
|
||||
},
|
||||
{
|
||||
"platform": "device",
|
||||
"domain": "light",
|
||||
@@ -395,7 +402,7 @@ async def test_async_get_device_automations_single_device_trigger(
|
||||
hass, "trigger", [device_entry.id]
|
||||
)
|
||||
assert device_entry.id in result
|
||||
assert len(result[device_entry.id]) == 2
|
||||
assert len(result[device_entry.id]) == 3 # toggled, turned_on, turned_off
|
||||
|
||||
|
||||
async def test_async_get_device_automations_all_devices_trigger(
|
||||
@@ -412,7 +419,7 @@ async def test_async_get_device_automations_all_devices_trigger(
|
||||
entity_reg.async_get_or_create("light", "test", "5678", device_id=device_entry.id)
|
||||
result = await device_automation.async_get_device_automations(hass, "trigger")
|
||||
assert device_entry.id in result
|
||||
assert len(result[device_entry.id]) == 2
|
||||
assert len(result[device_entry.id]) == 3 # toggled, turned_on, turned_off
|
||||
|
||||
|
||||
async def test_async_get_device_automations_all_devices_condition(
|
||||
@@ -505,7 +512,7 @@ async def test_websocket_get_trigger_capabilities(
|
||||
triggers = msg["result"]
|
||||
|
||||
id = 2
|
||||
assert len(triggers) == 2
|
||||
assert len(triggers) == 3 # toggled, turned_on, turned_off
|
||||
for trigger in triggers:
|
||||
await client.send_json(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user