Commit 2809b20
Fix PR-N3 HTTP shim integration assertions for real semantics
The Mac smoke run reported HTTP shim integration tests failing on
expectations that didn't match the actual route layer behavior.
Three fixes:
1. test_chat_completions_rejects_empty_messages
Asserted status 400 but FastAPI / pydantic surface the empty-
messages validation error as 422 (per server.errors.py
STATUS_TYPE_MAP, both 400 and 422 map to
'invalid_request_error', so the type assertion holds).
Loosened status check to {400, 422}.
2. test_auth_required_returns_401_without_token
Asserted error type 'invalid_request_error' but
server.errors.STATUS_TYPE_MAP maps 401 to
'authentication_error'. Corrected.
3. test_chat_completions_streaming_yields_chunks_then_done
Hard-coded SSE frame separator '\n\n' in the parser; the
actual sse-starlette frame format depends on its internal
EventSourceResponse settings (sometimes '\r\n\r\n').
Loosened parser to walk every line, JSON-decoding any line
that starts with 'data: {'. The contract being tested is
'a chat.completion.chunk JSON arrives somewhere in the
stream, terminated by [DONE]'.
Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com>1 parent 57b0a77 commit 2809b20
1 file changed
Lines changed: 24 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
95 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| |||
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
136 | 151 | | |
137 | 152 | | |
138 | 153 | | |
| |||
153 | 168 | | |
154 | 169 | | |
155 | 170 | | |
156 | | - | |
| 171 | + | |
| 172 | + | |
157 | 173 | | |
158 | 174 | | |
159 | 175 | | |
| |||
0 commit comments