generated from john/python-template
claude-sonnet-5 review: Phase 5 (final) implemented by gpt-5.3-codex
Quality Gate / gate (push) Failing after 37s
Quality Gate / gate (push) Failing after 37s
This commit is contained in:
@@ -110,6 +110,43 @@ async def test_openrouter_captures_exact_transport_and_secret_safe_manifest():
|
||||
assert result.request_manifest.omitted_optional_parameters == ("temperature", "top_p")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_openrouter_manifest_uses_configured_commit_not_ambient_env(monkeypatch):
|
||||
monkeypatch.setenv("TRANSCRIPTION_COMMIT", "ambient-value")
|
||||
|
||||
async def handler(request: httpx.Request) -> httpx.Response:
|
||||
return httpx.Response(
|
||||
200,
|
||||
content=(
|
||||
b'{"id":"gen-1","created":1,"model":"vendor/model","object":"chat.completion",'
|
||||
b'"system_fingerprint":null,"choices":[{"index":0,"finish_reason":"stop",'
|
||||
b'"message":{"role":"assistant","content":"Transcript"}}]}'
|
||||
),
|
||||
headers={"Content-Type": "application/json"},
|
||||
request=request,
|
||||
)
|
||||
|
||||
provider = OpenRouterTranscriptionProvider(
|
||||
settings=Settings(openrouter_api_key="test-key", transcription_commit="configured-commit"),
|
||||
async_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)),
|
||||
)
|
||||
result = await provider.transcribe(
|
||||
prompt_text="Literal prompt",
|
||||
image_bytes=b"source-bytes",
|
||||
mime_type="image/png",
|
||||
source_reference=SourceEvidenceReference(
|
||||
source_id=uuid4(),
|
||||
digest_sha256=hashlib.sha256(b"source-bytes").hexdigest(),
|
||||
byte_size=len(b"source-bytes"),
|
||||
media_type="image/png",
|
||||
page_number=1,
|
||||
),
|
||||
)
|
||||
|
||||
assert result.request_manifest is not None
|
||||
assert result.request_manifest.software.application_commit == "configured-commit"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_openrouter_captures_body_consumed_as_sdk_stream():
|
||||
response_body = (
|
||||
|
||||
Reference in New Issue
Block a user