Files
moma/renamer/test/test_mediainfo_extractor.py
T
sha 1d6eb9593e feat: Refactor formatting and extraction logic
- Added `langcodes` dependency for improved language handling.
- Replaced `ColorFormatter` with `TextFormatter` for consistent text styling across the application.
- Introduced `TrackFormatter` for better track information formatting.
- Updated `MediaFormatter` to utilize new formatting methods and improved data handling.
- Refactored `MediaExtractor` to enhance data extraction logic and improve readability.
- Removed deprecated `ColorFormatter` methods and replaced them with `TextFormatter` equivalents.
- Added new methods for extracting and formatting audio and subtitle tracks.
- Updated tests to reflect changes in the extraction logic and formatting.
2025-12-26 11:33:24 +00:00

32 lines
1.1 KiB
Python

import pytest
from pathlib import Path
from renamer.extractors.mediainfo_extractor import MediaInfoExtractor
class TestMediaInfoExtractor:
@pytest.fixture
def extractor(self):
return MediaInfoExtractor()
@pytest.fixture
def test_file(self):
"""Use the filenames.txt file for testing"""
return Path(__file__).parent / "filenames.txt"
def test_extract_resolution(self, extractor, test_file):
"""Test extracting resolution from media info"""
resolution = extractor.extract_resolution(test_file)
# Text files don't have video resolution
assert resolution is None
def test_extract_hdr(self, extractor, test_file):
"""Test extracting HDR info"""
hdr = extractor.extract_hdr(test_file)
# Text files don't have HDR
assert hdr is None
def test_extract_audio_langs(self, extractor, test_file):
"""Test extracting audio languages"""
langs = extractor.extract_audio_langs(test_file)
# Text files don't have audio tracks
assert langs == ''