Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coderai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
coderai
Commits
49c2f682
Commit
49c2f682
authored
May 06, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: tighten multimodal client request specs
parent
7ee24c18
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
17 deletions
+78
-17
test_manual_multimodal_test_client.py
tests/test_manual_multimodal_test_client.py
+78
-17
No files found.
tests/test_manual_multimodal_test_client.py
View file @
49c2f682
...
...
@@ -7,6 +7,8 @@ from tools.manual_multimodal_test_client import (
resolve_mode_config
,
)
import
pytest
def
test_parse_args_accepts_direct_mode_and_global_overrides
():
args
=
parse_args
([
...
...
@@ -136,10 +138,15 @@ def test_build_request_spec_for_llm_uses_chat_completions_payload(tmp_path):
spec
=
build_request_spec
(
config
)
assert
spec
[
"method"
]
==
"POST"
assert
spec
[
"url"
]
==
"http://127.0.0.1:6745/v1/chat/completions"
assert
spec
[
"json"
][
"model"
]
==
"text:test"
assert
spec
[
"json"
][
"messages"
][
0
][
"content"
]
==
"Ping"
assert
spec
==
{
"method"
:
"POST"
,
"url"
:
"http://127.0.0.1:6745/v1/chat/completions"
,
"headers"
:
{
"Accept"
:
"application/json"
},
"json"
:
{
"model"
:
"text:test"
,
"messages"
:
[{
"role"
:
"user"
,
"content"
:
"Ping"
}],
},
}
def
test_build_request_spec_for_transcription_uses_multipart_file
(
tmp_path
):
...
...
@@ -159,11 +166,18 @@ def test_build_request_spec_for_transcription_uses_multipart_file(tmp_path):
spec
=
build_request_spec
(
config
)
assert
spec
[
"url"
]
.
endswith
(
"/v1/audio/transcriptions"
)
assert
spec
[
"data"
][
"model"
]
==
"audio:test"
assert
spec
[
"data"
][
"prompt"
]
==
"Transcribe carefully"
assert
spec
[
"files"
][
"file"
][
0
]
==
"sample.wav"
assert
spec
[
"files"
][
"file"
][
1
]
==
b
"wav-bytes"
assert
spec
==
{
"method"
:
"POST"
,
"url"
:
"http://127.0.0.1:6745/v1/audio/transcriptions"
,
"headers"
:
{
"Accept"
:
"application/json"
},
"data"
:
{
"model"
:
"audio:test"
,
"prompt"
:
"Transcribe carefully"
,
},
"files"
:
{
"file"
:
(
"sample.wav"
,
b
"wav-bytes"
),
},
}
def
test_build_request_spec_for_audio_generation_uses_json_payload
(
tmp_path
):
...
...
@@ -181,10 +195,16 @@ def test_build_request_spec_for_audio_generation_uses_json_payload(tmp_path):
spec
=
build_request_spec
(
config
)
assert
spec
[
"url"
]
.
endswith
(
"/v1/audio/generate"
)
assert
spec
[
"json"
][
"model"
]
==
"audio_gen:test"
assert
spec
[
"json"
][
"prompt"
]
==
"Generate a bell sound"
assert
spec
[
"json"
][
"response_format"
]
==
"url"
assert
spec
==
{
"method"
:
"POST"
,
"url"
:
"http://127.0.0.1:6745/v1/audio/generate"
,
"headers"
:
{
"Accept"
:
"application/json"
},
"json"
:
{
"model"
:
"audio_gen:test"
,
"prompt"
:
"Generate a bell sound"
,
"response_format"
:
"url"
,
},
}
def
test_build_request_spec_for_video_generation_uses_json_payload
(
tmp_path
):
...
...
@@ -202,7 +222,48 @@ def test_build_request_spec_for_video_generation_uses_json_payload(tmp_path):
spec
=
build_request_spec
(
config
)
assert
spec
[
"url"
]
.
endswith
(
"/v1/video/generations"
)
assert
spec
[
"json"
][
"model"
]
==
"video:test"
assert
spec
[
"json"
][
"prompt"
]
==
"Generate a short test clip"
assert
spec
[
"json"
][
"response_format"
]
==
"url"
assert
spec
==
{
"method"
:
"POST"
,
"url"
:
"http://127.0.0.1:6745/v1/video/generations"
,
"headers"
:
{
"Accept"
:
"application/json"
},
"json"
:
{
"model"
:
"video:test"
,
"prompt"
:
"Generate a short test clip"
,
"response_format"
:
"url"
,
},
}
def
test_build_request_spec_for_transcription_requires_audio_file_flag
(
tmp_path
):
config
=
{
"mode"
:
"transcription"
,
"url"
:
"http://127.0.0.1:6745"
,
"model"
:
"audio:test"
,
"prompt"
:
"Transcribe carefully"
,
"output_dir"
:
tmp_path
,
"token"
:
None
,
"audio_file"
:
None
,
"video_file"
:
None
,
"response_format"
:
None
,
}
with
pytest
.
raises
(
FileNotFoundError
,
match
=
r"Missing required file\. Supply --audio-file\."
):
build_request_spec
(
config
)
def
test_build_request_spec_for_transcription_requires_existing_audio_file
(
tmp_path
):
missing_path
=
tmp_path
/
"missing.wav"
config
=
{
"mode"
:
"transcription"
,
"url"
:
"http://127.0.0.1:6745"
,
"model"
:
"audio:test"
,
"prompt"
:
"Transcribe carefully"
,
"output_dir"
:
tmp_path
,
"token"
:
None
,
"audio_file"
:
str
(
missing_path
),
"video_file"
:
None
,
"response_format"
:
None
,
}
with
pytest
.
raises
(
FileNotFoundError
,
match
=
rf
"File not found: {missing_path}
\
. Supply --audio-file
\
."
):
build_request_spec
(
config
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment