8000 Add input/output support in `run` command; update docs by kkroening · Pull Request #85 · kkroening/ffmpeg-python · GitHub
[go: up one dir, main page]

Skip to content

Add input/output support in run command; update docs #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 20, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix tests
  • Loading branch information
kkroening committed May 20, 2018
commit 6a2d3381b79d5a8feca2c11733d0e80388c6e28e
12 changes: 6 additions & 6 deletions ffmpeg/tests/test_ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,20 +329,20 @@ def test__run__capture_out(mocker, capture_stdout, capture_stderr):
stream = _get_simple_example()
out, err = ffmpeg.run(stream, capture_stdout=capture_stdout, capture_stderr=capture_stderr)
if capture_stdout:
assert out == 'test\n'
assert out == 'test\n'.encode()
else:
assert out is None
if capture_stderr:
assert err == ''
assert err == ''.encode()
else:
assert err is None


def test__run__input_output(mocker):
mocker.patch.object(ffmpeg._run, 'compile', return_value=['cat'])
stream = _get_simple_example()
out, err = ffmpeg.run(stream, input='test', capture_stdout=True)
assert out == 'test'
out, err = ffmpeg.run(stream, input='test'.encode(), capture_stdout=True)
assert out == 'test'.encode()
assert err is None


Expand All @@ -357,11 +357,11 @@ def test__run__error(mocker, capture_stdout, capture_stderr):
out = excinfo.value.stdout
err = excinfo.value.stderr
if capture_stdout:
assert out == ''
assert out == ''.encode()
else:
assert out is None
if capture_stderr:
assert err.startswith('ffmpeg version')
assert err.decode().startswith('ffmpeg version')
else:
assert err is None

Expand Down
0