Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use send_json_auto_id in conversation tests #109354

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions tests/components/conversation/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ async def test_ws_api(
assert await async_setup_component(hass, "conversation", {})
client = await hass_ws_client(hass)

await client.send_json({"id": 5, "type": "conversation/process", **payload})
await client.send_json_auto_id({"type": "conversation/process", **payload})

msg = await client.receive_json()

Expand All @@ -757,18 +757,14 @@ async def test_ws_prepare(

client = await hass_ws_client(hass)

msg = {
"id": 5,
"type": "conversation/prepare",
}
msg = {"type": "conversation/prepare"}
if agent_id is not None:
msg["agent_id"] = agent_id
await client.send_json(msg)
await client.send_json_auto_id(msg)

msg = await client.receive_json()

assert msg["success"]
assert msg["id"] == 5

# Intents should now be load
assert agent._lang_intents.get(hass.config.language)
Expand Down
3 changes: 1 addition & 2 deletions tests/components/conversation/test_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ async def test_subscribe_trigger_does_not_interfere_with_responses(
) -> None:
"""Test that subscribing to a trigger from the websocket API does not interfere with responses."""
websocket_client = await hass_ws_client()
await websocket_client.send_json(
await websocket_client.send_json_auto_id(
{
"id": 5,
"type": "subscribe_trigger",
"trigger": {"platform": "conversation", "command": ["test sentence"]},
}
Expand Down
Loading