test(providers): align SageMaker wire assertions with request semantics (#51536)

Co-authored-by: mateo <277851410+mateo-berri@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
devin-ai-integration[bot] 2026-11-13 03:21:56 +00:00 • committed by GitHub
parent eb811913f1
commit ba200f5773
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -406,14 +406,14 @@ def test_openai_route_sends_a_custom_deployment_key_at_the_top_level_of_the_body
assert _body(request) == {"input": [text], "input_type": "query", "model": SERVED_MODEL}, request.body
def test_deployment_extra_body_wins_over_the_callers_encoding_format(proxy: Gateway, wire: Wire) -> None:
def test_callers_encoding_format_wins_over_deployment_extra_body(proxy: Gateway, wire: Wire) -> None:
text: Final = _text()
created: Final = _sdk(proxy).embeddings.create(
model="sm-openai-pinned", input=[text], extra_body={"cache": _NO_CACHE}
)
assert [row.embedding for row in created.data] == [[0.25, -0.5, 1.0]], created
request: Final = _only_request(wire)
assert _body(request) == {"input": [text], "encoding_format": "float", "model": SERVED_MODEL}, request.body
assert _body(request) == {"input": [text], "encoding_format": "base64", "model": SERVED_MODEL}, request.body
def test_openai_route_returns_the_base64_string_a_raw_caller_asked_for_unchanged(proxy: Gateway, wire: Wire) -> None:
@ -533,7 +533,8 @@ def test_container_outage_errors_reach_the_caller_and_every_attempt_carries_the_
attempts: Final = wire.drain()
assert len(attempts) >= 1, attempts
assert {attempt.headers[COMPONENT_HEADER] for attempt in attempts} == {COMPONENT}, attempts
assert {attempt.body for attempt in attempts} == {json.dumps({"input": [text], "model": SERVED_MODEL}).encode()}
for attempt in attempts:
assert _body(attempt) == {"input": [text], "model": SERVED_MODEL}, attempt.body
assert _spend_row(response)["status"] == "failure"