feat: Add audio extraction endpoints and refactor sound API routes

This commit is contained in:
JSC
2025-08-01 21:39:42 +02:00
parent 6068599a47
commit d2d0240fdb
9 changed files with 150 additions and 124 deletions

View File

@@ -45,7 +45,7 @@ class TestSoundEndpoints:
mock_queue.return_value = None
response = await authenticated_client.post(
"/api/v1/sounds/extract",
"/api/v1/extractions/",
params={"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"},
)
@@ -62,7 +62,7 @@ class TestSoundEndpoints:
async def test_create_extraction_unauthenticated(self, client: AsyncClient) -> None:
"""Test extraction creation without authentication."""
response = await client.post(
"/api/v1/sounds/extract",
"/api/v1/extractions/",
params={"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"},
)
@@ -83,7 +83,7 @@ class TestSoundEndpoints:
mock_create.side_effect = ValueError("Invalid URL")
response = await authenticated_client.post(
"/api/v1/sounds/extract",
"/api/v1/extractions/",
params={"url": "invalid-url"},
)
@@ -114,7 +114,7 @@ class TestSoundEndpoints:
) as mock_get:
mock_get.return_value = mock_extraction_info
response = await authenticated_client.get("/api/v1/sounds/extract/1")
response = await authenticated_client.get("/api/v1/extractions/1")
assert response.status_code == 200
data = response.json()
@@ -135,7 +135,7 @@ class TestSoundEndpoints:
) as mock_get:
mock_get.return_value = None
response = await authenticated_client.get("/api/v1/sounds/extract/999")
response = await authenticated_client.get("/api/v1/extractions/999")
assert response.status_code == 404
data = response.json()
@@ -176,7 +176,7 @@ class TestSoundEndpoints:
) as mock_get:
mock_get.return_value = mock_extractions
response = await authenticated_client.get("/api/v1/sounds/extract")
response = await authenticated_client.get("/api/v1/extractions/")
assert response.status_code == 200
data = response.json()