Fix gallery upload tests broken by Session/HTTPError changes - #59
Merged
Conversation
The v2.8.0 reliability change routed requests through a requests.Session and made _check_status catch requests.HTTPError, but the gallery upload tests still patched module-level requests.get/post and raised a bare Exception, so patches missed and mismatch handling never triggered. Repoint patches to requests.Session.* and raise requests.HTTPError. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mKowalski256
requested review from
nebay-abraha
and
a lite review from Copilot
August 24, 2026 13:42
There was a problem hiding this comment.
Pull request overview
Updates the gallery filesystem unit tests to align with the newer ClientBase behavior that routes HTTP calls through a requests.Session and normalizes error handling via requests.HTTPError, ensuring the upload mismatch logic is exercised correctly.
Changes:
- Update test patches from module-level
requests.get/posttorequests.Session.get/postso mocks intercept the actual call path. - Update the failed-upload mock to raise
requests.HTTPError(matching_check_statusbehavior) instead of a bareException. - Add the
requestsimport required by the updated mock.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The v2.8.0 reliability change routed requests through a requests.Session and made _check_status catch requests.HTTPError, but the gallery upload tests still patched module-level requests.get/post and raised a bare Exception, so patches missed and mismatch handling never triggered.
Repoint patches to requests.Session.* and raise requests.HTTPError.