Refactor user endpoint tests to include pagination and response structure validation
- Updated tests for listing users to validate pagination and response format. - Changed mock return values to include total count and pagination details. - Refactored user creation mocks for clarity and consistency. - Enhanced assertions to check for presence of pagination fields in responses. - Adjusted test cases for user retrieval and updates to ensure proper handling of user data. - Improved readability by restructuring mock definitions and assertions across various test files.
This commit is contained in:
@@ -34,7 +34,8 @@ async def get_top_sounds(
|
||||
_current_user: Annotated[User, Depends(get_current_user)],
|
||||
dashboard_service: Annotated[DashboardService, Depends(get_dashboard_service)],
|
||||
sound_type: Annotated[
|
||||
str, Query(description="Sound type filter (SDB, TTS, EXT, or 'all')"),
|
||||
str,
|
||||
Query(description="Sound type filter (SDB, TTS, EXT, or 'all')"),
|
||||
],
|
||||
period: Annotated[
|
||||
str,
|
||||
@@ -43,7 +44,8 @@ async def get_top_sounds(
|
||||
),
|
||||
] = "all_time",
|
||||
limit: Annotated[
|
||||
int, Query(description="Number of top sounds to return", ge=1, le=100),
|
||||
int,
|
||||
Query(description="Number of top sounds to return", ge=1, le=100),
|
||||
] = 10,
|
||||
) -> list[dict[str, Any]]:
|
||||
"""Get top sounds by play count for a specific period."""
|
||||
|
||||
Reference in New Issue
Block a user