from mediagoblin.media_types.image import ImageMediaManager
from mediagoblin.media_types.pdf.processing import check_prerequisites as pdf_check_prerequisites
from mediagoblin.media_types.video.processing import (
- VideoProcessingManager, main_task, complimentary_task, group, processing_cleanup)
+ VideoProcessingManager, main_task, complimentary_task, group,
+ processing_cleanup, CommonVideoProcessor)
from mediagoblin.media_types.video.util import ACCEPTED_RESOLUTIONS
from mediagoblin.submit.lib import new_upload_entry, run_process_media
mock_chord.assert_called_once_with(transcoding_tasks)
entry.delete()
+ def test_accepted_files(self):
+ entry = get_sample_entry(self.our_user(), 'mediagoblin.media_types.video')
+ manager = VideoProcessingManager()
+ processor = CommonVideoProcessor(manager, entry)
+ acceptable_files = ['original, best_quality', 'webm_144p', 'webm_360p',
+ 'webm_480p', 'webm_720p', 'webm_1080p', 'webm_video']
+ assert processor.acceptable_files == acceptable_files
+
class TestSubmissionAudio(BaseTestSubmission):
@pytest.fixture(autouse=True)
from mediagoblin.media_types.video.transcoders import (capture_thumb,
VideoTranscoder)
+from mediagoblin.media_types.video.util import ACCEPTED_RESOLUTIONS
from mediagoblin.media_types.tools import discover
@contextmanager
dimensions=(640, 640))
assert len(discover(result_name).get_video_streams()) == 1
assert len(discover(result_name).get_audio_streams()) == 1
+
+def test_accepted_resolutions():
+ accepted_resolutions = {
+ '144p' : (256, 144),
+ '240p' : (352, 240),
+ '360p' : (480, 360),
+ '480p' : (858, 480),
+ '720p' : (1280, 720),
+ '1080p' : (1920, 1080),
+ }
+ assert accepted_resolutions == ACCEPTED_RESOLUTIONS