()
| 66 | |
| 67 | |
| 68 | def test_classifies_common_http_statuses(): |
| 69 | assert classify_error("HTTP 401: invalid api key").code == "AUTH_OR_PERMISSION" |
| 70 | assert classify_error("HTTP 403: forbidden").code == "AUTH_OR_PERMISSION" |
| 71 | assert classify_error("HTTP 429: rate limit").code == "RATE_LIMITED" |
| 72 | |
| 73 | upstream = classify_error("HTTP 500: upstream exploded") |
| 74 | assert upstream.code == "UPSTREAM_UNAVAILABLE" |
| 75 | assert upstream.status == 502 |
| 76 | |
| 77 | |
| 78 | def test_error_payload_keeps_compat_error_message(): |
nothing calls this directly
no test coverage detected