Skip to content

Add unit tests for category endpoints - #16

Merged
pavog merged 2 commits into
masterfrom
add-category-tests
Oct 16, 2026
Merged

pavog merged 2 commits into
masterfrom
add-category-tests

Conversation

@pavog

@pavog pavog commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Depends on #15


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

  • getCategories(): only gameId is sent by default, without classId or classesOnly. The results are mapped to Category.
  • getCategories() with classId and classesOnly: classesOnly is sent as true (see Fix boolean query parameters #14)
  • getCategory(): requests all categories of the game and returns the one with the given id
  • getCategory() with an unknown id returns null

The fixture getCategories.json is a recorded response from the real CurseForge API, shortened to a few entries.

@pavog
pavog requested a review from JulianVennen October 15, 2026 18:07
@pavog
pavog merged commit e851161 into master Oct 16, 2026
4 checks passed
@pavog
pavog deleted the add-category-tests branch October 16, 2026 09:34
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