fix: 修复ingest测试MagicMock写入SQLite导致Unit Tests失败 (#601)
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1413h48m43s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been skipped
CI/CD Pipeline / Unit Tests (push) Has been skipped
CI/CD Pipeline / Integration Tests (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (push) Has been skipped

Co-authored-by: xiaoxia <dev@xiaoxiajianji.com>
Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
This commit was merged in pull request #601.
This commit is contained in:
2026-07-19 17:40:44 +08:00
committed by auto-approve-bot
parent bf137350c6
commit edb118a5a0
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -249,7 +249,7 @@ class Asset:
storage_key=storage_key.strip(),
mime_type=mime_type.strip(),
file_size=file_size,
thumbnail_url=thumbnail_url,
thumbnail_url=str(thumbnail_url) if thumbnail_url else None,
duration=duration,
width=width,
height=height,
+3 -2
View File
@@ -339,9 +339,10 @@ class TestIngestAssetValidation:
True,
)
with patch("worker_app.tasks.ingest.SessionLocal", return_value=db):
from worker_app.tasks.ingest import ingest_asset
with patch("video_processing.thumbnail_generator.generate_and_upload_thumbnail", return_value=None):
from worker_app.tasks.ingest import ingest_asset
result = ingest_asset("job-valid-001")
result = ingest_asset("job-valid-001")
assert result["status"] == "completed"
assert "asset_id" in result