Refactor test cases for improved readability and consistency
- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user