2 Commits

Author SHA1 Message Date
PerryLink
d58d86d940 test(server-py): pin the retryable image-failure status mapping
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.
2026-09-11 20:01:20 +08:00
icrim
57b9c84242 Initial commit
Co-authored-by: xinchengxx <xinchengxx@deepseek.com>
Co-authored-by: XieJiSS <xiejiss@deepseek.com>
Co-authored-by: yqaty <jiayu@deepseek.com>
Co-authored-by: zhu-he <hezhu@deepseek.com>
Co-authored-by: season-guo <seasonguo@deepseek.com>
2026-09-10 18:07:01 +08:00