mirror of
https://github.com/shadoll/moma.git
synced 2026-08-28 19:43:28 +00:00
- 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.
32 lines
1.1 KiB
Python
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 == '' |