@@ -101,7 +101,7 @@ def test_stream_repr():
101
101
assert repr (dummy_out ) == 'dummy()[{!r}] <{}>' .format (dummy_out .label , dummy_out .node .short_hash )
102
102
103
103
104
- def test_get_args_simple ():
104
+ def test__get_args__simple ():
105
105
out_file = ffmpeg .input ('dummy.mp4' ).output ('dummy2.mp4' )
106
106
assert out_file .get_args () == ['-i' , 'dummy.mp4' , 'dummy2.mp4' ]
107
107
@@ -138,7 +138,7 @@ def _get_complex_filter_example():
138
138
)
139
139
140
140
141
- def test_get_args_complex_filter ():
141
+ def test__get_args__complex_filter ():
142
142
out = _get_complex_filter_example ()
143
143
args = ffmpeg .get_args (out )
144
144
assert args == ['-i' , TEST_INPUT_FILE1 ,
@@ -309,13 +309,13 @@ def _get_drawtext_text_repr(text):
309
309
# subprocess.check_call(['ffmpeg', '-version'])
310
310
311
311
312
- def test_compile ():
312
+ def test__compile ():
313
313
out_file = ffmpeg .input ('dummy.mp4' ).output ('dummy2.mp4' )
314
314
assert out_file .compile () == ['ffmpeg' , '-i' , 'dummy.mp4' , 'dummy2.mp4' ]
315
315
assert out_file .compile (cmd = 'ffmpeg.old' ) == ['ffmpeg.old' , '-i' , 'dummy.mp4' , 'dummy2.mp4' ]
316
316
317
317
318
- def test_run ():
318
+ def test__run ():
319
319
stream = _get_complex_filter_example ()
320
320
out , err = ffmpeg .run (stream )
321
321
assert out is None
@@ -324,7 +324,7 @@ def test_run():
324
EDBE
td>324
325
325
@pytest .mark .parametrize ('capture_stdout' , [True , False ])
326
326
@pytest .mark .parametrize ('capture_stderr' , [True , False ])
327
- def test_run__capture_out (mocker , capture_stdout , capture_stderr ):
327
+ def test__run__capture_out (mocker , capture_stdout , capture_stderr ):
328
328
mocker .patch .object (ffmpeg ._run , 'compile' , return_value = ['echo' , 'test' ])
329
329
stream = _get_simple_example ()
330
330
out , err = ffmpeg .run (stream , capture_stdout = capture_stdout , capture_stderr = capture_stderr )
@@ -338,7 +338,7 @@ def test_run__capture_out(mocker, capture_stdout, capture_stderr):
338
338
assert err is None
339
339
340
340
341
- def test_run__input_output (mocker ):
341
+ def test__run__input_output (mocker ):
342
342
mocker .patch .object (ffmpeg ._run , 'compile' , return_value = ['cat' ])
343
343
stream = _get_simple_example ()
344
344
out , err = ffmpeg .run (stream , input = 'test' , capture_stdout = True )
@@ -348,11 +348,12 @@ def test_run__input_output(mocker):
348
348
349
349
@pytest .mark .parametrize ('capture_stdout' , [True , False ])
350
350
@pytest .mark .parametrize ('capture_stderr' , [True , False ])
351
- def test_run__error (mocker , capture_stdout , capture_stderr ):
351
+ def test__run__error (mocker , capture_stdout , capture_stderr ):
352
352
mocker .patch .object (ffmpeg ._run , 'compile' , return_value = ['ffmpeg' ])
353
353
stream = _get_complex_filter_example ()
354
354
with pytest .raises (ffmpeg .Error ) as excinfo :
355
355
out , err = ffmpeg .run (stream , capture_stdout = capture_stdout , capture_stderr = capture_stderr )
356
+ assert str (excinfo .value ) == 'ffmpeg error (see stderr output for detail)'
356
357
out = excinfo .value .stdout
357
358
err = excinfo .value .stderr
358
359
if capture_stdout :
@@ -365,24 +366,24 @@ def test_run__error(mocker, capture_stdout, capture_stderr):
365
366
assert err is None
366
367
367
368
368
- def test_run__multi_output ():
369
+ def test__run__multi_output ():
369
370
in_ = ffmpeg .input (TEST_INPUT_FILE1 )
370
371
out1 = in_ .output (TEST_OUTPUT_FILE1 )
371
372
out2 = in_ .output (TEST_OUTPUT_FILE2 )
372
373
ffmpeg .run ([out1 , out2 ], overwrite_output = True )
373
374
374
375
375
- def test_run__dummy_cmd ():
376
+ def test__run__dummy_cmd ():
376
377
stream = _get_complex_filter_example ()
377
378
ffmpeg .run (stream , cmd = 'true' )
378
379
379
380
380
- def test_run__dummy_cmd_list ():
381
+ def test__run__dummy_cmd_list ():
381
382
stream = _get_complex_filter_example ()
382
383
ffmpeg .run (stream , cmd = ['true' , 'ignored' ])
383
384
384
385
385
- def test_filter__custom ():
386
+ def test__filter__custom ():
386
387
stream = ffmpeg .input ('dummy.mp4' )
387
388
stream = ffmpeg .filter_ (stream , 'custom_filter' , 'a' , 'b' , kwarg1 = 'c' )
388
389
stream = ffmpeg .output (stream , 'dummy2.mp4' )
@@ -394,7 +395,7 @@ def test_filter__custom():
394
395
]
395
396
396
397
397
- def test_filter__custom_fluent ():
398
+ def test__filter__custom_fluent ():
398
399
stream = (ffmpeg
399
400
.input ('dummy.mp4' )
400
401
.filter_ ('custom_filter' , 'a' , 'b' , kwarg1 = 'c' )
@@ -408,7 +409,7 @@ def test_filter__custom_fluent():
408
409
]
409
410
410
411
411
- def test_merge_outputs ():
412
+ def test__merge_outputs ():
412
413
in_ = ffmpeg .input ('in.mp4' )
413
414
out1 = in_ .output ('out1.mp4' )
414
415
out2 = in_ .output ('out2.mp4' )
@@ -484,14 +485,14 @@ def test_pipe():
484
485
assert out_data == in_data [start_frame * frame_size :]
485
486
486
487
487
- def test_ffprobe ():
488
+ def test__probe ():
488
489
data = ffmpeg .probe (TEST_INPUT_FILE1 )
489
490
assert set (data .keys ()) == {'format' , 'streams' }
490
491
assert data ['format' ]['duration' ] == '7.036000'
491
492
492
493
493
- def test_ffprobe_exception ():
494
+ def test__probe__exception ():
494
495
with pytest .raises (ffmpeg .Error ) as excinfo :
495
496
ffmpeg .probe (BOGUS_INPUT_FILE )
496
- assert str (excinfo .value ) == 'ffprobe error'
497
+ assert str (excinfo .value ) == 'ffprobe error (see stderr output for detail) '
497
498
assert 'No such file or directory' .encode () in excinfo .value .stderr
0 commit comments