From 2528854e19087f11a6b7466b8ddfbbf6bc6cbcf2 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 29 Jul 2026 21:58:28 +0800 Subject: [PATCH] test(domain): add wave197 asset/asset_library compat tests (+12) Add tests for compatibility layer modules: - asset.py: AssetType constants + re-exports - asset_library.py: LibraryKind constants + re-exports This completes domain layer zero-test module cleanup. --- 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 -- 2.54.0