mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
test(streaming): assert queued first-error JSON response (#51849)
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:
parent
8fc6789295
commit
969386fb73
1 changed files with 5 additions and 4 deletions
|
|
@ -451,10 +451,11 @@ def test_failure_hook_replacement_ends_a_queue_stream_that_fails_before_the_firs
|
|||
marker: Final = _marker()
|
||||
body: Final = _body("clean", marker, (_RAISING,), "raise-builtin-after-0", _REPLACE, priority=0)
|
||||
response: Final = rig.proxy.gateway.request("POST", "/queue/chat/completions", body)
|
||||
ended: Final = _ended_in_band(response, 200)
|
||||
assert ended.content == "", response.text
|
||||
assert ended.error["code"] == "403", ended.error
|
||||
assert ended.error["message"] == _REPLACEMENT_MESSAGE, ended.error
|
||||
assert response.status_code == 403, response.text
|
||||
assert response.headers["content-type"] == "application/json", response.headers
|
||||
assert JSON_OBJECT.validate_json(response.content) == {
|
||||
"error": {"message": _REPLACEMENT_MESSAGE, "type": "permission_error", "param": None, "code": "403"}
|
||||
}, response.text
|
||||
assert _CRASH_MESSAGE not in response.text, response.text
|
||||
assert _calls_with(rig.upstream, marker) == 1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue