WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@appleboy
Copy link
Owner

@appleboy appleboy commented May 1, 2025

  • Add tests for parsing header strings into http.Header, covering normal input, invalid format, duplicate keys, and empty/nil input
  • Add tests for DefaultHeaderTransport to verify attaching custom headers, handling empty app info, propagating errors, and supporting multiple header values

appleboy added 2 commits May 1, 2025 17:25
- Add tests for parsing header strings into http.Header, covering normal input, invalid format, duplicate keys, and empty/nil input
- Add tests for DefaultHeaderTransport to verify attaching custom headers, handling empty app info, propagating errors, and supporting multiple header values

Signed-off-by: appleboy <[email protected]>
- Use NewRequestWithContext with a background context in tests instead of NewRequest
- Add error handling and fail tests immediately if RoundTrip returns an error
- Ensure HTTP response bodies are closed after each test to prevent resource leaks

Signed-off-by: appleboy <[email protected]>
@appleboy appleboy merged commit bebb2ee into main May 1, 2025
10 checks passed
@appleboy appleboy deleted the test branch May 1, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants