Repository navigation
test: cover blob upload chunk boundaries - #758
Open
j45856021-dev wants to merge 1 commit into
Open
j45856021-dev wants to merge 1 commit into
j45856021-dev wants to merge 1 commit into
Conversation
Verify binary content, digest paths, and returned digests for both clients at and beyond the 32 KiB read boundary, with HTTP 200 and 201 responses. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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 existing direct
create_blobtests use empty files, so they do not exercise binary content or reads beyond the first 32 KiB chunk.Add a 20-case matrix for
ClientandAsyncClient, HTTP 200/201, and payload lengths 0, 1, 32768, 32769, and 65537 bytes. It checks the complete request body, exact digest URL, returned digest, and one upload request. This is test-only; production code and thecreate()API are unchanged.Validation
66 passed on Python 3.13/macOS. Configured Ruff lint and formatting passed. Local fault injection confirmed that emptying the body fails all 16 nonempty cases, while truncating it to the first 32768 bytes fails exactly the eight larger-payload cases; the empty, one-byte, and exact-boundary controls still pass.
The new tests use the existing HTTPX
MockTransportpattern and the actual source checkout. The sandbox prevented the existing socket-based tests from binding localhost and the VCS build backend from accessing Git configuration, so the full suite and package build were not completed. No Ollama server/model execution is claimed.Disclosure: investigation, tests, and PR text were prepared autonomously with AI; no human pre-review is claimed.