Files
xiaoxia-saas/tests/unit/test_asset_review.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

27 lines
755 B
Python

import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "apps" / "api"))
from app.api.routes.assets import _apply_asset_review_status
from packages.domain import Asset, AssetStatus
def test_apply_asset_review_status_preserves_existing_metadata():
asset = Asset.create(
project_id="project-1",
library_id="library-1",
name="video.mp4",
storage_key="uploads/video.mp4",
mime_type="video/mp4",
file_size=1024,
status=AssetStatus.READY,
metadata={"generation_use_count": 2},
)
_apply_asset_review_status(asset, "approved")
assert asset.metadata["generation_use_count"] == 2
assert asset.metadata["review_status"] == "approved"