Skip to content
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
Updated test to check the new cwd parameter
  • Loading branch information
Jacotsu committed Oct 9, 2020
commit 17995f5ff3ab77f3b6736783c4b180283ec0fc15
9 changes: 6 additions & 3 deletions ffmpeg/tests/test_ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,14 @@ def test__compile():
@pytest.mark.parametrize('pipe_stdin', [True, False])
@pytest.mark.parametrize('pipe_stdout', [True, False])
@pytest.mark.parametrize('pipe_stderr', [True, False])
def test__run_async(mocker, pipe_stdin, pipe_stdout, pipe_stderr):
@pytest.mark.parametrize('cwd', [None, '/tmp'])
def test__run_async(mocker, pipe_stdin, pipe_stdout, pipe_stderr, cwd):
process__mock = mock.Mock()
popen__mock = mocker.patch.object(subprocess, 'Popen', return_value=process__mock)
stream = _get_simple_example()
process = ffmpeg.run_async(
stream, pipe_stdin=pipe_stdin, pipe_stdout=pipe_stdout, pipe_stderr=pipe_stderr
stream, pipe_stdin=pipe_stdin, pipe_stdout=pipe_stdout,
pipe_stderr=pipe_stderr, cwd=cwd
)
assert process is process__mock

Expand All @@ -456,7 +458,8 @@ def test__run_async(mocker, pipe_stdin, pipe_stdout, pipe_stderr):
(args,), kwargs = popen__mock.call_args
assert args == ffmpeg.compile(stream)
assert kwargs == dict(
stdin=expected_stdin, stdout=expected_stdout, stderr=expected_stderr
stdin=expected_stdin, stdout=expected_stdout, stderr=expected_stderr,
cwd=cwd
)


Expand Down