mirror of
https://github.com/shadoll/moma.git
synced 2026-08-28 11:33:25 +00:00
feat: Add conversion and deletion confirmation screens, enhance media panel properties
- Implemented ConvertConfirmScreen for confirming AVI to MKV conversions with audio and subtitle options. - Added DeleteConfirmScreen for confirming file deletions with detailed file information. - Enhanced MediaPanelView to include additional MediaInfo properties such as video, audio, and subtitle tracks. - Updated MediaPanelProperties to extract and display raw MediaInfo track data. - Introduced HelpScreen for user guidance on application features and navigation. - Created OpenScreen for directory path input with validation. - Developed RenameConfirmScreen for renaming files with user confirmation and editing capabilities. - Added SettingsScreen for configuring application settings, including cache TTL and HEVC encoding options. - Updated imports and module exports in views to accommodate new screens.
This commit is contained in:
@@ -19,26 +19,29 @@ with open(test_cases_file, 'r', encoding='utf-8') as f:
|
||||
@pytest.mark.parametrize("test_case", test_cases, ids=[tc['testname'] for tc in test_cases])
|
||||
def test_frame_class_detection(test_case):
|
||||
"""Test frame class detection for various resolutions"""
|
||||
|
||||
|
||||
testname = test_case['testname']
|
||||
width, height = test_case['resolution']
|
||||
interlaced = test_case['interlaced']
|
||||
expected = test_case['expected_frame_class']
|
||||
|
||||
|
||||
# Create a mock MediaInfoExtractor
|
||||
extractor = MagicMock(spec=MediaInfoExtractor)
|
||||
from pathlib import Path
|
||||
extractor.file_path = Path(f"test_{testname}") # Set a unique file_path for caching
|
||||
|
||||
|
||||
# Mock the video_tracks
|
||||
mock_track = MagicMock()
|
||||
mock_track.height = height
|
||||
mock_track.width = width
|
||||
mock_track.interlaced = 'Yes' if interlaced else 'No'
|
||||
|
||||
|
||||
extractor.video_tracks = [mock_track]
|
||||
|
||||
extractor.extract_resolution.return_value = (height, width)
|
||||
extractor._video_tracks.return_value = [mock_track]
|
||||
extractor.extract_interlaced.return_value = interlaced
|
||||
|
||||
# Test the method
|
||||
actual = MediaInfoExtractor.extract_frame_class(extractor)
|
||||
|
||||
assert actual == expected, f"{testname}: expected {expected}, got {actual}"
|
||||
|
||||
assert actual == expected, f"{testname}: expected {expected}, got {actual}"
|
||||
|
||||
Reference in New Issue
Block a user