Skip to content

Add unit tests for file endpoints - #18

Merged
pavog merged 1 commit into
masterfrom
add-file-tests
Oct 16, 2026
Merged

pavog merged 1 commit into
masterfrom
add-file-tests

Conversation

@pavog

@pavog pavog commented Oct 16, 2026

Copy link
Copy Markdown
Member

This PR adds unit tests for the file endpoints of CurseForgeAPIClient. They run against the mocked HTTP client from ClientTestCase.

getModFiles():

  • With no options, only index=0 and pageSize=50 are sent. The results are mapped to File.
  • All options are set and every query parameter is checked. clientCompatible is sent as true (see Fix boolean query parameters #14).
  • getNextPage() keeps the filters of the first request and only changes the offset.

getModFile()

  • getFiles(): sends a POST to /v1/mods/files with fileIds in the body
  • getModFileChangelog(): once without query parameters, once with raw, stripped and markup
  • getModFileDownloadURL()

The fixtures are recorded responses from the real CurseForge API for mclogs (420561).

@pavog
pavog merged commit 1147a02 into master Oct 16, 2026
5 checks passed
@pavog
pavog deleted the add-file-tests branch October 16, 2026 10:03
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.

1 participant