From e0b95e69d4436fe6121c320aa5568b43eca1bb7d Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 30 Jul 2026 00:25:07 +0800 Subject: [PATCH] =?UTF-8?q?test(domain):=20wave197=20asset/asset=5Flibrary?= =?UTF-8?q?=20=E5=85=BC=E5=AE=B9=E5=B1=82=20+12=20(#1161)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/domain/test_asset_compat.py | 61 ++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 tests/unit/domain/test_asset_compat.py diff --git a/tests/unit/domain/test_asset_compat.py b/tests/unit/domain/test_asset_compat.py new file mode 100755 index 000000000..a9efdd4ce --- /dev/null +++ b/tests/unit/domain/test_asset_compat.py @@ -0,0 +1,61 @@ +"""asset / asset_library 兼容层单元测试.""" + +from __future__ import annotations + +from domain.asset import Asset, AssetStatus, AssetType, ClassificationStatus +from domain.asset_library import AssetLibrary, AssetLibraryKind, LibraryKind + + +class TestAssetType: + """AssetType 常量类测试.""" + + def test_video_value(self): + assert AssetType.VIDEO == "video" + + def test_image_value(self): + assert AssetType.IMAGE == "image" + + def test_audio_value(self): + assert AssetType.AUDIO == "audio" + + def test_three_types(self): + assert AssetType.VIDEO + assert AssetType.IMAGE + assert AssetType.AUDIO + + +class TestAssetReexports: + """asset.py 重导出测试.""" + + def test_asset_reexported(self): + # Asset 类从 entities 转发,确认可访问 + assert Asset is not None + + def test_asset_status_reexported(self): + assert AssetStatus is not None + + def test_classification_status_reexported(self): + assert ClassificationStatus is not None + + +class TestLibraryKind: + """LibraryKind 常量类测试.""" + + def test_video_value(self): + assert LibraryKind.VIDEO == AssetLibraryKind.VIDEO + + def test_voice_value(self): + assert LibraryKind.VOICE == AssetLibraryKind.VOICE + + def test_image_value(self): + assert LibraryKind.IMAGE == AssetLibraryKind.IMAGE + + +class TestAssetLibraryReexports: + """asset_library.py 重导出测试.""" + + def test_asset_library_reexported(self): + assert AssetLibrary is not None + + def test_asset_library_kind_reexported(self): + assert AssetLibraryKind is not None