Files
xiaoxia-saas/tests/unit/test_task_center.py
API文档维护Agent e3fb518ab2
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
refactor: remove all workspace_id references from codebase
- Remove workspace_id from Pydantic models in project_management routes
- Remove workspace_id from SQLAlchemy and SQLite project management repos
- Remove workspace_id from worker tasks (storage keys, entity creation)
- Remove workspace_id from video dedup and title usage modules
- Remove workspace_id from generation and ingest worker tasks
- Clean workspace_id from all test files and scripts
- Remove workspace-specific test files (list_workspaces, workspace repos)

Task: #14 workspace_id 残留清理
2026-06-27 22:52:09 +08:00

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) == "导入完成"