926d0fa272
Tests / test (push) Failing after 0s
Tests / lint (push) Failing after 0s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
26 lines
774 B
Python
26 lines
774 B
Python
import sys
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "apps" / "api"))
|
|
|
|
from app.api.routes.task_center import _humanize_task_error, _ingest_step
|
|
|
|
from packages.domain import IngestJob, IngestJobStatus
|
|
|
|
|
|
def test_humanize_task_error_for_media_failures():
|
|
assert "MP4" in _humanize_task_error("ffmpeg invalid data found")
|
|
assert "OSS" in _humanize_task_error("oss bucket read failed")
|
|
assert "不存在" in _humanize_task_error("file not found")
|
|
|
|
|
|
def test_ingest_step_is_user_readable():
|
|
job = IngestJob.create(
|
|
project_id="project-1",
|
|
library_id="library-1",
|
|
storage_key="uploads/video.mp4",
|
|
)
|
|
job.status = IngestJobStatus.COMPLETED
|
|
|
|
assert _ingest_step(job) == "导入完成"
|