def test_process_video(tmpdir): base, ext = os.path.splitext(TEST_VIDEO) settings = create_settings(video_format='ogv', use_orig=True, orig_link=True) process_video(SRCFILE, str(tmpdir), settings) dstfile = str(tmpdir.join(base + '.ogv')) assert os.path.realpath(dstfile) == SRCFILE settings = create_settings(video_format='mjpg') assert process_video(SRCFILE, str(tmpdir), settings) == Status.FAILURE settings = create_settings(thumb_video_delay=-1) assert process_video(SRCFILE, str(tmpdir), settings) == Status.FAILURE
def test_process_video(tmpdir): base, ext = os.path.splitext(TEST_VIDEO) settings = create_settings(video_format='ogv', use_orig=True, orig_link=True, source=os.path.join(SRCDIR, 'video'), destination=str(tmpdir)) video = Video(TEST_VIDEO, '.', settings) process_video(video) dstfile = str(tmpdir.join(base + '.ogv')) assert os.path.realpath(dstfile) == SRCFILE settings = create_settings(video_format='mjpg') assert process_video(video) == Status.FAILURE settings = create_settings(thumb_video_delay=-1) assert process_video(video) == Status.FAILURE