Refactor sound and extraction services to include user and timestamp fields
- Updated ExtractionInfo to include user_id, created_at, and updated_at fields. - Modified ExtractionService to return user and timestamp information in extraction responses. - Enhanced sound serialization in PlayerState to include extraction URL if available. - Adjusted PlaylistRepository to load sound extractions when retrieving playlist sounds. - Added tests for new fields in extraction and sound endpoints, ensuring proper response structure. - Created new test file endpoints for sound downloads and thumbnail retrievals, including success and error cases. - Refactored various test cases for consistency and clarity, ensuring proper mocking and assertions.
This commit is contained in:
@@ -31,6 +31,9 @@ class TestSoundEndpoints:
|
||||
"status": "pending",
|
||||
"error": None,
|
||||
"sound_id": None,
|
||||
"user_id": authenticated_user.id,
|
||||
"created_at": "2025-08-03T12:00:00Z",
|
||||
"updated_at": "2025-08-03T12:00:00Z",
|
||||
}
|
||||
|
||||
with (
|
||||
@@ -107,6 +110,9 @@ class TestSoundEndpoints:
|
||||
"status": "completed",
|
||||
"error": None,
|
||||
"sound_id": 42,
|
||||
"user_id": authenticated_user.id,
|
||||
"created_at": "2025-08-03T12:00:00Z",
|
||||
"updated_at": "2025-08-03T12:00:00Z",
|
||||
}
|
||||
|
||||
with patch(
|
||||
@@ -158,6 +164,9 @@ class TestSoundEndpoints:
|
||||
"status": "completed",
|
||||
"error": None,
|
||||
"sound_id": 42,
|
||||
"user_id": authenticated_user.id,
|
||||
"created_at": "2025-08-03T12:00:00Z",
|
||||
"updated_at": "2025-08-03T12:00:00Z",
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
@@ -168,6 +177,9 @@ class TestSoundEndpoints:
|
||||
"status": "pending",
|
||||
"error": None,
|
||||
"sound_id": None,
|
||||
"user_id": authenticated_user.id,
|
||||
"created_at": "2025-08-03T12:00:00Z",
|
||||
"updated_at": "2025-08-03T12:00:00Z",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user