diff --git a/apps/worker/video_processing/url_security.py b/apps/worker/video_processing/url_security.py index 3ea89d178..c2096752d 100644 --- a/apps/worker/video_processing/url_security.py +++ b/apps/worker/video_processing/url_security.py @@ -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, +) diff --git a/tests/unit/domain/test_classification.py b/tests/unit/domain/test_classification.py index 09077950a..7fdd31f3e 100644 --- a/tests/unit/domain/test_classification.py +++ b/tests/unit/domain/test_classification.py @@ -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" diff --git a/tests/unit/test_multi_track_subtitle_concat.py b/tests/unit/test_multi_track_subtitle_concat.py index f24c83296..e6ac5c255 100755 --- a/tests/unit/test_multi_track_subtitle_concat.py +++ b/tests/unit/test_multi_track_subtitle_concat.py @@ -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})