test(downloader): add unit tests for HTTP client #129

Closed
opened 2026-07-13 17:28:41 +00:00 by the.auditor · 1 comment
Owner

internal/downloader/client.go has no tests. The HTTP client is foundational for all download functionality.

Should cover:

  • NewClient creates client with correct timeout from config
  • NewRequest sets User-Agent header from config
  • NewRequest creates request with context
  • Do delegates to underlying http.Client

Consider using httptest.NewServer for integration-style tests.

Discovered during review of PR #127.

`internal/downloader/client.go` has no tests. The HTTP client is foundational for all download functionality. Should cover: - `NewClient` creates client with correct timeout from config - `NewRequest` sets User-Agent header from config - `NewRequest` creates request with context - `Do` delegates to underlying http.Client Consider using `httptest.NewServer` for integration-style tests. Discovered during review of PR #127.
Owner

Closing — handled in PR #164. client_test.go covers NewClient, NewRequest, custom headers, Do, and context support.

Closing — handled in PR #164. client_test.go covers NewClient, NewRequest, custom headers, Do, and context support.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/pget#129
No description provided.