Simplify wake_word/info + improve test coverage (#100902)

* Simplify wake_word/info + improve test coverage

* Fix test

* Revert unrelated changes
This commit is contained in:
Erik Montnemery
2023-09-26 14:07:27 -05:00
committed by GitHub
parent 4028596977
commit b281fa17fc
2 changed files with 22 additions and 2 deletions
+21
View File
@@ -287,3 +287,24 @@ async def test_list_wake_words(
{"id": "test_ww_2", "name": "Test Wake Word 2"},
]
}
async def test_list_wake_words_unknown_entity(
hass: HomeAssistant,
setup: MockProviderEntity,
hass_ws_client: WebSocketGenerator,
) -> None:
"""Test that the list_wake_words websocket command works."""
client = await hass_ws_client(hass)
await client.send_json(
{
"id": 5,
"type": "wake_word/info",
"entity_id": "wake_word.blah",
}
)
msg = await client.receive_json()
assert not msg["success"]
assert msg["error"] == {"code": "not_found", "message": "Entity not found"}