Files
xiaoxia-saas/tests/unit/test_worker_ingest.py
T
Xiaoxia AI 2cccc1b1d1
Deploy / Build Production Runtime Images (push) Successful in 8m51s
Deploy / Deploy Production (push) Successful in 56s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
fix(upload): support mov assets and large web uploads
2026-06-23 11:44:10 +08:00

20 lines
734 B
Python

import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "apps" / "worker"))
from worker_app.core.asset_types import infer_mime_type_from_storage_key
def test_infer_mime_type_treats_mov_as_video():
assert infer_mime_type_from_storage_key("uploads/abc/DBLQ7915.MOV") == "video/quicktime"
def test_infer_mime_type_treats_common_video_extensions_as_video():
for filename in ["clip.mp4", "clip.m4v", "clip.avi", "clip.mkv", "clip.webm"]:
assert infer_mime_type_from_storage_key(f"uploads/abc/{filename}") == "video/mp4"
def test_infer_mime_type_keeps_unknown_files_as_image_placeholder():
assert infer_mime_type_from_storage_key("uploads/abc/photo.jpg") == "image/jpeg"