Add tests for extraction API endpoints and enhance existing tests
Some checks failed
Backend CI / lint (push) Successful in 9m25s
Backend CI / test (push) Failing after 4m48s

- Implement tests for admin extraction API endpoints including status retrieval, deletion of extractions, and permission checks.
- Add tests for user extraction deletion, ensuring proper handling of permissions and non-existent extractions.
- Enhance sound endpoint tests to include duplicate handling in responses.
- Refactor favorite service tests to utilize mock dependencies for better maintainability and clarity.
- Update sound scanner tests to improve file handling and ensure proper deletion of associated files.
This commit is contained in:
JSC
2025-08-25 21:40:31 +02:00
parent d3ce17f10d
commit 7dee6e320e
15 changed files with 1560 additions and 721 deletions

View File

@@ -201,7 +201,7 @@ class ExtractionProcessor:
for extraction in stuck_extractions:
try:
await extraction_service.extraction_repo.update(
extraction, {"status": "pending", "error": None}
extraction, {"status": "pending", "error": None},
)
reset_count += 1
logger.info(
@@ -210,12 +210,13 @@ class ExtractionProcessor:
)
except Exception:
logger.exception(
"Failed to reset extraction %d", extraction.id
"Failed to reset extraction %d", extraction.id,
)
await session.commit()
logger.info(
"Successfully reset %d stuck extractions from processing to pending",
"Successfully reset %d stuck extractions from processing to "
"pending",
reset_count,
)