#34: re-add overwrite_output operator but have it raise an exception

This commit is contained in:
Karl Kroening 2017-11-02 17:24:44 -07:00
parent 39f3ecec37
commit 7989c5d8a3
2 changed files with 14 additions and 0 deletions

View File

@ -23,6 +23,14 @@ def input(filename, **kwargs):
return InputNode(input.__name__, kwargs=kwargs).stream()
@output_operator()
def overwrite_output(stream):
"""No longer supported; see ``overwrite_output`` parameter of ``get_args`` function instead.
"""
raise NameError('`overwrite_output` operator is no longer supported; see `overwrite_output` parameter of '
'`get_args` function instead')
@output_operator()
def merge_outputs(*streams):
"""Include all given outputs in one ffmpeg command line
@ -50,4 +58,5 @@ __all__ = [
'input',
'merge_outputs',
'output',
'overwrite_output',
]

View File

@ -99,6 +99,11 @@ def test_stream_repr():
assert repr(dummy_out) == "dummy()[{!r}] <{}>".format(dummy_out.label, dummy_out.node.short_hash)
def test_overwrite_output():
with pytest.raises(NameError):
ffmpeg.input('dummy.mp4').output('dummy2.mp4').overwrite_output()
def test_get_args_simple():
out_file = ffmpeg.input('dummy.mp4').output('dummy2.mp4')
assert out_file.get_args() == ['-i', 'dummy.mp4', 'dummy2.mp4', '-y']