Files
xiaoxia-saas/tests/unit/test_task_center.py
T
Xiaoxia AI 6e00c9d3c3
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 18s
Deploy / Deploy Staging (push) Successful in 1s
style: sort Python imports for CI
2026-06-24 19:57:19 +08:00

27 lines
810 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(
workspace_id="workspace-1",
project_id="project-1",
library_id="library-1",
storage_key="uploads/video.mp4",
)
job.status = IngestJobStatus.COMPLETED
assert _ingest_step(job) == "导入完成"