mirror of
https://github.com/deepseek-ai/deepseek-recipe.git
synced 2026-10-28 17:17:08 +08:00
The example server derived the HTTP status of an `ImageError` from `kind` alone, so an upstream image host answering 503 was reported to the API client as 400 `invalid_request_error` - the client was told its request was malformed, and should not be retried. `ImageError.is_retryable` is the library's own classification of exactly that: `Fetch` is retryable regardless of its source, and `FetchStatus` is retryable at 5xx. That is what the previous commit keys the status off. This adds the coverage the fix left out. A local stub origin answers 503 and 404, and the test pins the status and error type each one maps to. The 503 case fails against the previous revision, so the assertion is load-bearing rather than incidental. Uses only the standard library (http.server, threading), so the suite needs no new dependency. |
||
|---|---|---|
| .. | ||
| test_smoke.py | ||