Add comprehensive tests for formatter classes, services, and utilities

- Introduced tests for various formatter classes including TextFormatter, DurationFormatter, SizeFormatter, DateFormatter, and more to ensure correct formatting behavior.
- Added tests for service classes such as FileTreeService, MetadataService, and RenameService, covering directory validation, metadata extraction, and file renaming functionalities.
- Implemented utility tests for LanguageCodeExtractor, PatternExtractor, and FrameClassMatcher to validate their extraction and matching capabilities.
- Updated test cases to use datasets for better maintainability and clarity.
- Enhanced error handling tests to ensure robustness against missing or invalid data.
This commit is contained in:
sha
2025-12-31 14:04:33 +00:00
parent c5fbd367fc
commit 262c0a7b7d
45 changed files with 3346 additions and 1057 deletions
+3 -3
View File
@@ -11,9 +11,9 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from renamer.extractors.mediainfo_extractor import MediaInfoExtractor
from pathlib import Path
# Load test cases from JSON file using context manager
test_cases_file = Path(__file__).parent / 'test_mediainfo_frame_class.json'
with open(test_cases_file, 'r') as f:
# Load test cases from dataset using context manager
test_cases_file = Path(__file__).parent / 'datasets' / 'mediainfo' / 'frame_class_tests.json'
with open(test_cases_file, 'r', encoding='utf-8') as f:
test_cases = json.load(f)
@pytest.mark.parametrize("test_case", test_cases, ids=[tc['testname'] for tc in test_cases])