Repository navigation
test: cover empty redirect and not-modified responses - #265
Merged
Vincent Biret (baywet) merged 1 commit intoSep 21, 2026
Merged
Vincent Biret (baywet) merged 1 commit into
Vincent Biret (baywet) merged 1 commit into
Conversation
Shubham Padkonde (Shubham-Padkonde)
requested a review
from a team
as a code owner
September 21, 2026 07:23
Vincent Biret (baywet)
approved these changes
Sep 21, 2026
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The changes add focused regression coverage with no unresolved review issues.
Review effort: Lite
Findings: None
What changed in this PR
Adds regression tests for empty 302 and 304 responses without Location headers across request adapter methods.
Changes:
- Adds local HTTP server coverage for 302 and 304 responses.
- Covers model, collection, enum, primitive, byte, and no-content requests.
| File | Description |
|---|---|
nethttp_request_adapter_redirect_test.go |
Adds comprehensive empty redirect and not-modified response tests. |
💡 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.
Closes #163.
Adds the requested coverage for empty 3xx responses without a
Locationheader. A real local HTTP server returns 302 or 304, and the tests exercise model, model collection, enum, enum collection, primitive, primitive collection, byte and no-content requests. Each must complete without an error and return nil where applicable.Current main already handles these responses correctly, so this changes tests only. This follows the review guidance on the withdrawn #166 to retain the existing status-code condition and cover the scenario through the request adapter.
Validation on Linux with Go 1.26.3:
throwIfFailedResponseto reject statuses >= 300 makes all 16 cases fail withApiError; the production file was restored byte-for-byte before final validation.go test -race ./...,go vet ./..., andgo build ./...pass.No live Microsoft Graph calls or other OS/toolchain tests were run. This contribution and its validation were prepared with OpenAI Codex assistance; no independent human review is claimed.