File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -106,10 +106,10 @@ def get_args(node):
106
106
def run (node , cmd = 'ffmpeg' ):
107
107
"""Run ffmpeg on node graph."""
108
108
if isinstance (cmd , basestring ):
109
- args = [cmd ]
109
+ cmd = [cmd ]
110
110
elif type (cmd ) != list :
111
- args = list (cmd )
112
- args += node .get_args ()
111
+ cmd = list (cmd )
112
+ args = cmd + node .get_args ()
113
113
_subprocess .check_call (args )
114
114
115
115
Original file line number Diff line number Diff line change 1
1
import ffmpeg
2
2
import os
3
+ import pytest
3
4
import subprocess
4
5
5
6
@@ -118,4 +119,21 @@ def test_get_args_complex_filter():
118
119
119
120
120
121
def test_run ():
121
- ffmpeg .run (_get_complex_filter_example ())
122
+ node = _get_complex_filter_example ()
123
+ ffmpeg .run (node )
124
+
125
+
126
+ def test_run_dummy_cmd ():
127
+ node = _get_complex_filter_example ()
128
+ ffmpeg .run (node , cmd = 'true' )
129
+
130
+
131
+ def test_run_dummy_cmd_list ():
132
+ node = _get_complex_filter_example ()
133
+ ffmpeg .run (node , cmd = ['true' , 'ignored' ])
134
+
135
+
136
+ def test_run_failing_cmd ():
137
+ node = _get_complex_filter_example ()
138
+ with pytest .raises (subprocess .CalledProcessError ):
139
+ ffmpeg .run (node , cmd = 'false' )
You can’t perform that action at this time.
0 commit comments