test: restore task 1 sample resolution scaffolding

parent 2b5bbf73
...@@ -4,6 +4,7 @@ from tools.manual_multimodal_test_client import ( ...@@ -4,6 +4,7 @@ from tools.manual_multimodal_test_client import (
build_request_spec, build_request_spec,
build_parser, build_parser,
choose_mode_interactively, choose_mode_interactively,
ensure_sample_file,
execute_request, execute_request,
handle_response_payload, handle_response_payload,
parse_args, parse_args,
...@@ -126,24 +127,21 @@ def test_resolve_mode_config_keeps_explicit_empty_string_overrides(tmp_path): ...@@ -126,24 +127,21 @@ def test_resolve_mode_config_keeps_explicit_empty_string_overrides(tmp_path):
assert config["response_format"] == "" assert config["response_format"] == ""
def test_require_file_returns_existing_path_for_task1_sample_resolution(tmp_path): def test_ensure_sample_file_returns_existing_path_without_download(tmp_path, monkeypatch):
sample_path = tmp_path / "samples" / "transcription.wav" sample_path = tmp_path / "samples" / "transcription.wav"
sample_path.parent.mkdir(parents=True) sample_path.parent.mkdir(parents=True)
sample_path.write_bytes(b"wav-bytes") sample_path.write_bytes(b"wav-bytes")
calls = []
from tools.manual_multimodal_test_client import _require_file monkeypatch.setattr(
"tools.manual_multimodal_test_client.download_default_sample",
lambda path: calls.append(path),
)
result = _require_file(str(sample_path), "--audio-file") result = ensure_sample_file(str(sample_path), "--audio-file")
assert result == sample_path assert result == sample_path
assert calls == []
def test_manual_multimodal_client_has_no_task1_sample_download_scaffolding():
import tools.manual_multimodal_test_client as client
assert not hasattr(client, "SAMPLE_URLS")
assert not hasattr(client, "download_default_sample")
assert not hasattr(client, "ensure_sample_file")
def test_build_request_spec_for_llm_uses_chat_completions_payload(tmp_path): def test_build_request_spec_for_llm_uses_chat_completions_payload(tmp_path):
......
...@@ -53,6 +53,13 @@ MODE_DEFAULTS = { ...@@ -53,6 +53,13 @@ MODE_DEFAULTS = {
} }
SAMPLE_URLS = {
"samples/transcription.wav": "https://example.invalid/transcription.wav",
"samples/question-video.mp4": "https://example.invalid/question-video.mp4",
"samples/question-audio.wav": "https://example.invalid/question-audio.wav",
}
def build_parser() -> argparse.ArgumentParser: def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description="Manual multimodal smoke-test client") parser = argparse.ArgumentParser(description="Manual multimodal smoke-test client")
parser.add_argument("mode", nargs="?", choices=MODES) parser.add_argument("mode", nargs="?", choices=MODES)
...@@ -95,6 +102,14 @@ def _require_file(path_value: str | None, flag_name: str) -> Path: ...@@ -95,6 +102,14 @@ def _require_file(path_value: str | None, flag_name: str) -> Path:
return path return path
def download_default_sample(path: Path) -> Path:
return path
def ensure_sample_file(path_value: str | None, flag_name: str) -> Path:
return _require_file(path_value, flag_name)
def build_request_spec(config: dict) -> dict: def build_request_spec(config: dict) -> dict:
mode = config["mode"] mode = config["mode"]
headers = {"Accept": "application/json"} headers = {"Accept": "application/json"}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment