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
1f1d0393
Commit
1f1d0393
authored
May 06, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: auto-resolve missing managed sample files
parent
19729cfe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
test_manual_multimodal_test_client.py
tests/test_manual_multimodal_test_client.py
+26
-0
manual_multimodal_test_client.py
tools/manual_multimodal_test_client.py
+12
-1
No files found.
tests/test_manual_multimodal_test_client.py
View file @
1f1d0393
...
...
@@ -144,6 +144,32 @@ def test_ensure_sample_file_returns_existing_path_without_download(tmp_path, mon
assert
calls
==
[]
def
test_ensure_sample_file_downloads_missing_managed_default
(
tmp_path
,
monkeypatch
):
managed_path
=
tmp_path
/
"samples"
/
"question-audio.wav"
downloaded
=
[]
def
fake_download
(
path
):
downloaded
.
append
(
path
)
path
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
path
.
write_bytes
(
b
"audio"
)
return
path
monkeypatch
.
setattr
(
"tools.manual_multimodal_test_client.SAMPLE_URLS"
,
{
managed_path
.
as_posix
():
"https://example.invalid/question-audio.wav"
},
)
monkeypatch
.
setattr
(
"tools.manual_multimodal_test_client.download_default_sample"
,
fake_download
,
)
result
=
ensure_sample_file
(
str
(
managed_path
),
"--audio-file"
)
assert
result
==
managed_path
assert
downloaded
==
[
managed_path
]
assert
managed_path
.
read_bytes
()
==
b
"audio"
def
test_build_request_spec_for_llm_uses_chat_completions_payload
(
tmp_path
):
config
=
{
"mode"
:
"llm"
,
...
...
tools/manual_multimodal_test_client.py
View file @
1f1d0393
...
...
@@ -106,8 +106,19 @@ def download_default_sample(path: Path) -> Path:
return
path
def
_managed_sample_key
(
path
:
Path
)
->
str
:
return
path
.
as_posix
()
def
ensure_sample_file
(
path_value
:
str
|
None
,
flag_name
:
str
)
->
Path
:
return
_require_file
(
path_value
,
flag_name
)
if
not
path_value
:
raise
FileNotFoundError
(
f
"Missing required file. Supply {flag_name}."
)
path
=
Path
(
path_value
)
if
path
.
exists
():
return
path
if
_managed_sample_key
(
path
)
in
SAMPLE_URLS
:
return
download_default_sample
(
path
)
raise
FileNotFoundError
(
f
"File not found: {path}. Supply {flag_name}."
)
def
build_request_spec
(
config
:
dict
)
->
dict
:
...
...
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