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
27 lines
755 B
Python
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"
|