test: guard reasoning-free telemetry through real client paths
This commit is contained in:
@@ -405,3 +405,31 @@ class TestLifecycle:
|
||||
await t.check_health(source=_source())
|
||||
await t.aclose()
|
||||
await t.aclose()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("method", ["recognize_text", "parse_layout"])
|
||||
async def test_ocr_wire_does_not_send_reasoning_configuration(method):
|
||||
"""真实 multipart 与 ZIP 下载两段均不发送源级推理配置。"""
|
||||
sent = []
|
||||
|
||||
def handler(request):
|
||||
sent.append(request)
|
||||
if request.method == "GET":
|
||||
return httpx.Response(200, content=_zip_bytes())
|
||||
return httpx.Response(
|
||||
200, json=_text_body() if method == "recognize_text" else _parse_body()
|
||||
)
|
||||
|
||||
transport = _transport_for(handler)
|
||||
try:
|
||||
await getattr(transport, method)(
|
||||
image=b"image",
|
||||
source=_source(enable_thinking=True, reasoning_effort="high"),
|
||||
call_id="wire",
|
||||
)
|
||||
assert len(sent) == (1 if method == "recognize_text" else 2)
|
||||
for request in sent:
|
||||
for key in (b"reasoning_effort", b"enable_thinking", b"thinking_budget"):
|
||||
assert key not in request.content
|
||||
finally:
|
||||
await transport.aclose()
|
||||
|
||||
Reference in New Issue
Block a user