fix: 修复develop分支Unit Tests 14个失败
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1m14s
AI Code Review / AI Code Review (pull_request) Successful in 1m13s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 2m48s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 2m5s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m55s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m57s
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / PR Build API Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 1180h53m2s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1180h53m16s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 1180h53m4s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 1180h53m19s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1180h53m44s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 1180h55m36s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 1180h55m40s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1181h26m5s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 1181h26m41s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 1181h28m37s

YAML bug期间CI不触发,代码重构后测试未同步更新,导致14个单元测试失败。

修复内容:
1. video_processing/url_security.py: ALLOWED_VIDEO_MIME_TYPES已移至packages.domain,
   兼容层导入路径错误导致整个模块加载失败,连锁引发多个测试ImportError
2. test_multi_track_subtitle_concat.py: POSITION_ALIGNMENT已移至packages.domain.subtitle_style
3. test_classification.py: AssetLibraryKind新增IMAGE枚举,测试断言从2改为3
This commit is contained in:
2026-07-29 10:30:18 +08:00
parent 4c31026f81
commit 6a07b43d7e
3 changed files with 12 additions and 5 deletions
+4 -1
View File
@@ -9,7 +9,6 @@ from packages.shared.url_security import ( # noqa: F401
ALLOWED_IMAGE_MIME_TYPES,
ALLOWED_PORTS,
ALLOWED_SCHEMES,
ALLOWED_VIDEO_MIME_TYPES,
DEFAULT_MAX_DOWNLOAD_SIZE,
MAX_URL_LENGTH,
TRUSTED_DOMAINS,
@@ -19,3 +18,7 @@ from packages.shared.url_security import ( # noqa: F401
safe_download_file,
validate_url_safety,
)
from packages.domain.url_security import ( # noqa: F401
ALLOWED_VIDEO_MIME_TYPES,
)
+6 -3
View File
@@ -18,9 +18,9 @@ from packages.domain.classification import (
class TestAssetLibraryKind:
"""AssetLibraryKind 枚举测试."""
def test_two_values(self):
"""视频和配音两类."""
assert len(AssetLibraryKind) == 2
def test_three_values(self):
"""视频/配音/图片三类."""
assert len(AssetLibraryKind) == 3
def test_video(self):
assert AssetLibraryKind.VIDEO == "video"
@@ -28,6 +28,9 @@ class TestAssetLibraryKind:
def test_voice(self):
assert AssetLibraryKind.VOICE == "voice"
def test_image(self):
assert AssetLibraryKind.IMAGE == "image"
def test_str_compatible(self):
"""StrEnum 字符串兼容."""
assert AssetLibraryKind.VIDEO == "video"
@@ -468,7 +468,8 @@ class TestSubtitleStyle:
assert style3.alignment == 5
def test_9grid_positions(self):
from video_processing.subtitle_render_engine import POSITION_ALIGNMENT, SubtitleStyle
from packages.domain.subtitle_style import POSITION_ALIGNMENT
from video_processing.subtitle_render_engine import SubtitleStyle
for pos, align in POSITION_ALIGNMENT.items():
style = SubtitleStyle.from_dict({"position": pos})