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

28 lines
791 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(
workspace_id="workspace-1",
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"