Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
4276ce96
Unverified
Commit
4276ce96
authored
1 year ago
by
Erik Montnemery
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Use send_json_auto_id in voice_assistant tests (#90857)
parent
41046599
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/components/voice_assistant/test_websocket.py
+9
-18
9 additions, 18 deletions
tests/components/voice_assistant/test_websocket.py
with
9 additions
and
18 deletions
tests/components/voice_assistant/test_websocket.py
+
9
−
18
View file @
4276ce96
...
...
@@ -17,9 +17,8 @@ async def test_text_only_pipeline(
"""
Test events from a pipeline run with text input (no STT/TTS).
"""
client
=
await
hass_ws_client
(
hass
)
await
client
.
send_json
(
await
client
.
send_json
_auto_id
(
{
"
id
"
:
5
,
"
type
"
:
"
voice_assistant/run
"
,
"
start_stage
"
:
"
intent
"
,
"
end_stage
"
:
"
intent
"
,
...
...
@@ -57,9 +56,8 @@ async def test_audio_pipeline(
"""
Test events from a pipeline run with audio input/output.
"""
client
=
await
hass_ws_client
(
hass
)
await
client
.
send_json
(
await
client
.
send_json
_auto_id
(
{
"
id
"
:
5
,
"
type
"
:
"
voice_assistant/run
"
,
"
start_stage
"
:
"
stt
"
,
"
end_stage
"
:
"
tts
"
,
...
...
@@ -127,9 +125,8 @@ async def test_intent_timeout(
"
homeassistant.components.conversation.async_converse
"
,
new
=
sleepy_converse
,
):
await
client
.
send_json
(
await
client
.
send_json
_auto_id
(
{
"
id
"
:
5
,
"
type
"
:
"
voice_assistant/run
"
,
"
start_stage
"
:
"
intent
"
,
"
end_stage
"
:
"
intent
"
,
...
...
@@ -174,9 +171,8 @@ async def test_text_pipeline_timeout(
"
homeassistant.components.voice_assistant.pipeline.PipelineInput.execute
"
,
new
=
sleepy_run
,
):
await
client
.
send_json
(
await
client
.
send_json
_auto_id
(
{
"
id
"
:
5
,
"
type
"
:
"
voice_assistant/run
"
,
"
start_stage
"
:
"
intent
"
,
"
end_stage
"
:
"
intent
"
,
...
...
@@ -208,9 +204,8 @@ async def test_intent_failed(
"
homeassistant.components.conversation.async_converse
"
,
new
=
MagicMock
(
return_value
=
RuntimeError
),
):
await
client
.
send_json
(
await
client
.
send_json
_auto_id
(
{
"
id
"
:
5
,
"
type
"
:
"
voice_assistant/run
"
,
"
start_stage
"
:
"
intent
"
,
"
end_stage
"
:
"
intent
"
,
...
...
@@ -254,9 +249,8 @@ async def test_audio_pipeline_timeout(
"
homeassistant.components.voice_assistant.pipeline.PipelineInput.execute
"
,
new
=
sleepy_run
,
):
await
client
.
send_json
(
await
client
.
send_json
_auto_id
(
{
"
id
"
:
5
,
"
type
"
:
"
voice_assistant/run
"
,
"
start_stage
"
:
"
stt
"
,
"
end_stage
"
:
"
tts
"
,
...
...
@@ -286,9 +280,8 @@ async def test_stt_provider_missing(
):
client
=
await
hass_ws_client
(
hass
)
await
client
.
send_json
(
await
client
.
send_json
_auto_id
(
{
"
id
"
:
5
,
"
type
"
:
"
voice_assistant/run
"
,
"
start_stage
"
:
"
stt
"
,
"
end_stage
"
:
"
tts
"
,
...
...
@@ -313,9 +306,8 @@ async def test_stt_stream_failed(
):
client
=
await
hass_ws_client
(
hass
)
await
client
.
send_json
(
await
client
.
send_json
_auto_id
(
{
"
id
"
:
5
,
"
type
"
:
"
voice_assistant/run
"
,
"
start_stage
"
:
"
stt
"
,
"
end_stage
"
:
"
tts
"
,
...
...
@@ -394,9 +386,8 @@ async def test_invalid_stage_order(
"""
Test pipeline run with invalid stage order.
"""
client
=
await
hass_ws_client
(
hass
)
await
client
.
send_json
(
await
client
.
send_json
_auto_id
(
{
"
id
"
:
5
,
"
type
"
:
"
voice_assistant/run
"
,
"
start_stage
"
:
"
tts
"
,
"
end_stage
"
:
"
stt
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment