diff --git a/src/speedruncompy/endpoints.py b/src/speedruncompy/endpoints.py index c98ce19..ae33553 100644 --- a/src/speedruncompy/endpoints.py +++ b/src/speedruncompy/endpoints.py @@ -546,12 +546,16 @@ class GetModerationRuns(PostRequest[r_GetModerationRuns], BasePaginatedRequest[r ### Mandatory: - @gameId + - @limit: # TODO: range + - @page ### Optional: - - @limit: + - @search + - @verified: `Verified` + - @verifiedById """ - def __init__(self, gameId: str, **params) -> None: - super().__init__("GetModerationRuns", returns=r_GetModerationRuns, gameId=gameId, **params) + def __init__(self, gameId: str, limit: int, page: int = 1, **params) -> None: + super().__init__("GetModerationRuns", returns=r_GetModerationRuns, gameId=gameId, limit=limit, page=page, **params) def _combine_results(self, pages: dict): # TODO: is this all really necessary? diff --git a/test/test_endpoints.py b/test/test_endpoints.py index 0a8b725..dda95c4 100644 --- a/test/test_endpoints.py +++ b/test/test_endpoints.py @@ -462,23 +462,23 @@ def test_GetModerationGames_unauthed(self): assert result.games is None def test_GetModerationRuns(self): - result = GetModerationRuns(_api=self.api, gameId=game_id).perform() + result = GetModerationRuns(_api=self.api, gameId=game_id, limit=20, page=1).perform() log_result(result) check_datatype_coverage(result) def test_GetModerationRuns_paginated(self): - result = GetModerationRuns(_api=self.api, gameId=game_id, verified=Verified.PENDING).perform_all() + result = GetModerationRuns(_api=self.api, gameId=game_id, limit=20, page=1, verified=Verified.PENDING).perform_all() log_result(result) check_datatype_coverage(result) def test_GetModerationRuns_paginated_raw(self): - result = GetModerationRuns(_api=self.api, gameId=game_id, verified=Verified.PENDING)._perform_all_raw() + result = GetModerationRuns(_api=self.api, gameId=game_id, limit=20, page=1, verified=Verified.PENDING)._perform_all_raw() log_result(result) check_pages(result) def test_GetModerationRuns_unauthed(self): with pytest.raises(Unauthorized): - GetModerationRuns(gameId=game_id, verified=Verified.PENDING).perform() + GetModerationRuns(gameId=game_id, limit=20, page=1, verified=Verified.PENDING).perform() def test_GetNotifications(self): result = GetNotifications(_api=self.api).perform()