From 1c9695d2a0b079e5d1e9d6fb3ecbeaf248b365a9 Mon Sep 17 00:00:00 2001 From: Karl Kroening Date: Fri, 5 Jul 2019 19:16:43 -0500 Subject: [PATCH] Run Black code formatter --- ffmpeg/tests/test_ffmpeg.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ffmpeg/tests/test_ffmpeg.py b/ffmpeg/tests/test_ffmpeg.py index b40d624..279a323 100644 --- a/ffmpeg/tests/test_ffmpeg.py +++ b/ffmpeg/tests/test_ffmpeg.py @@ -717,6 +717,7 @@ def test__probe__extra_args(): data = ffmpeg.probe(TEST_INPUT_FILE1, show_frames=None) assert set(data.keys()) == {'format', 'streams', 'frames'} + def get_filter_complex_input(flt, name): m = re.search(r'\[([^]]+)\]{}(?=[[;]|$)'.format(name), flt) if m: @@ -724,6 +725,7 @@ def get_filter_complex_input(flt, name): else: return None + def get_filter_complex_outputs(flt, name): m = re.search(r'(^|[];]){}((\[[^]]+\])+)(?=;|$)'.format(name), flt) if m: @@ -731,6 +733,7 @@ def get_filter_complex_outputs(flt, name): else: return None + def test__get_filter_complex_input(): assert get_filter_complex_input("", "scale") is None assert get_filter_complex_input("scale", "scale") is None @@ -739,6 +742,7 @@ def test__get_filter_complex_input(): assert get_filter_complex_input("[s2]scale;etc", "scale") == "s2" assert get_filter_complex_input("[s2]scale[s3][s4];etc", "scale") == "s2" + def test__get_filter_complex_outputs(): assert get_filter_complex_outputs("", "scale") is None assert get_filter_complex_outputs("scale", "scale") is None @@ -750,17 +754,18 @@ def test__get_filter_complex_outputs(): assert get_filter_complex_outputs("[s5]scale[s1];x", "scale") == ['s1'] assert get_filter_complex_outputs("y;[s5]scale[s1];x", "scale") == ['s1'] + def test__multi_output_edge_label_order(): - scale2ref = ffmpeg.filter_multi_output([ffmpeg.input('x'), ffmpeg.input('y')], 'scale2ref') - out = ( - ffmpeg.merge_outputs( - scale2ref[1].filter('scale').output('a'), - scale2ref[10000].filter('hflip').output('b') - ) + scale2ref = ffmpeg.filter_multi_output( + [ffmpeg.input('x'), ffmpeg.input('y')], 'scale2ref' + ) + out = ffmpeg.merge_outputs( + scale2ref[1].filter('scale').output('a'), + scale2ref[10000].filter('hflip').output('b'), ) args = out.get_args() - flt_cmpl = args[args.index('-filter_complex')+1] + flt_cmpl = args[args.index('-filter_complex') + 1] out1, out2 = get_filter_complex_outputs(flt_cmpl, 'scale2ref') assert out1 == get_filter_complex_input(flt_cmpl, 'scale') assert out2 == get_filter_complex_input(flt_cmpl, 'hflip')