Enable Ruff A001 (#115654)
This commit is contained in:
parent
8754b12d08
commit
895f73d8e4
36 changed files with 347 additions and 321 deletions
|
@ -328,23 +328,23 @@ async def test_websocket_get_action_capabilities(
|
|||
assert msg["success"]
|
||||
actions = msg["result"]
|
||||
|
||||
id = 2
|
||||
msg_id = 2
|
||||
assert len(actions) == 3
|
||||
for action in actions:
|
||||
await client.send_json(
|
||||
{
|
||||
"id": id,
|
||||
"id": msg_id,
|
||||
"type": "device_automation/action/capabilities",
|
||||
"action": action,
|
||||
}
|
||||
)
|
||||
msg = await client.receive_json()
|
||||
assert msg["id"] == id
|
||||
assert msg["id"] == msg_id
|
||||
assert msg["type"] == TYPE_RESULT
|
||||
assert msg["success"]
|
||||
capabilities = msg["result"]
|
||||
assert capabilities == expected_capabilities[action["type"]]
|
||||
id = id + 1
|
||||
msg_id = msg_id + 1
|
||||
|
||||
|
||||
async def test_websocket_get_action_capabilities_unknown_domain(
|
||||
|
@ -487,23 +487,23 @@ async def test_websocket_get_condition_capabilities(
|
|||
assert msg["success"]
|
||||
conditions = msg["result"]
|
||||
|
||||
id = 2
|
||||
msg_id = 2
|
||||
assert len(conditions) == 2
|
||||
for condition in conditions:
|
||||
await client.send_json(
|
||||
{
|
||||
"id": id,
|
||||
"id": msg_id,
|
||||
"type": "device_automation/condition/capabilities",
|
||||
"condition": condition,
|
||||
}
|
||||
)
|
||||
msg = await client.receive_json()
|
||||
assert msg["id"] == id
|
||||
assert msg["id"] == msg_id
|
||||
assert msg["type"] == TYPE_RESULT
|
||||
assert msg["success"]
|
||||
capabilities = msg["result"]
|
||||
assert capabilities == expected_capabilities
|
||||
id = id + 1
|
||||
msg_id = msg_id + 1
|
||||
|
||||
|
||||
async def test_websocket_get_condition_capabilities_unknown_domain(
|
||||
|
@ -775,23 +775,23 @@ async def test_websocket_get_trigger_capabilities(
|
|||
assert msg["success"]
|
||||
triggers = msg["result"]
|
||||
|
||||
id = 2
|
||||
msg_id = 2
|
||||
assert len(triggers) == 3 # toggled, turned_on, turned_off
|
||||
for trigger in triggers:
|
||||
await client.send_json(
|
||||
{
|
||||
"id": id,
|
||||
"id": msg_id,
|
||||
"type": "device_automation/trigger/capabilities",
|
||||
"trigger": trigger,
|
||||
}
|
||||
)
|
||||
msg = await client.receive_json()
|
||||
assert msg["id"] == id
|
||||
assert msg["id"] == msg_id
|
||||
assert msg["type"] == TYPE_RESULT
|
||||
assert msg["success"]
|
||||
capabilities = msg["result"]
|
||||
assert capabilities == expected_capabilities
|
||||
id = id + 1
|
||||
msg_id = msg_id + 1
|
||||
|
||||
|
||||
async def test_websocket_get_trigger_capabilities_unknown_domain(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue