Refactor test cases for improved readability and consistency
All checks were successful
Backend CI / lint (push) Successful in 9m49s
Backend CI / test (push) Successful in 6m15s

- Adjusted function signatures in various test files to enhance clarity by aligning parameters.
- Updated patching syntax for better readability across test cases.
- Improved formatting and spacing in test assertions and mock setups.
- Ensured consistent use of async/await patterns in async test functions.
- Enhanced comments for better understanding of test intentions.
This commit is contained in:
JSC
2025-08-01 20:53:30 +02:00
parent d926779fe4
commit 6068599a47
39 changed files with 691 additions and 286 deletions

View File

@@ -2,7 +2,7 @@
from typing import Annotated
from fastapi import APIRouter, Depends, HTTPException, Query, status
from fastapi import APIRouter, Depends, HTTPException, status
from sqlmodel.ext.asyncio.session import AsyncSession
from app.core.database import get_db, get_session_factory
@@ -18,7 +18,6 @@ from app.services.vlc_player import VLCPlayerService, get_vlc_player_service
router = APIRouter(prefix="/sounds", tags=["sounds"])
async def get_extraction_service(
session: Annotated[AsyncSession, Depends(get_db)],
) -> ExtractionService:
@@ -43,7 +42,6 @@ async def get_sound_repository(
return SoundRepository(session)
# EXTRACT
@router.post("/extract")
async def create_extraction(
@@ -60,7 +58,8 @@ async def create_extraction(
)
extraction_info = await extraction_service.create_extraction(
url, current_user.id,
url,
current_user.id,
)
# Queue the extraction for background processing
@@ -83,8 +82,6 @@ async def create_extraction(
}
@router.get("/extract/{extraction_id}")
async def get_extraction(
extraction_id: int,
@@ -206,7 +203,6 @@ async def play_sound_with_vlc(
}
@router.post("/stop")
async def stop_all_vlc_instances(
current_user: Annotated[User, Depends(get_current_active_user_flexible)], # noqa: ARG001