Skip to content
Snippets Groups Projects
Commit 73e55b58 authored by Martin Craig's avatar Martin Craig
Browse files

Updated logcmd test for new interpretation of this parameter

It is now a stream in its own right rather than a boolean
parent 55d57e02
No related branches found
No related tags found
No related merge requests found
......@@ -353,20 +353,22 @@ def test_run_logcmd():
exit 0
""").strip()
expstdout = './script.sh 1 2 3\noutput 1 2 3\n'
expcmd = './script.sh 1 2 3\n'
expstdout = 'output 1 2 3\n'
with tempdir.tempdir():
mkexec('script.sh', test_script)
stdout = run.run('./script.sh 1 2 3', log={'cmd' : True})
assert stdout == expstdout
mkexec('script.sh', test_script)
stdout = run.run('./script.sh 1 2 3', log={'cmd' : True})
assert stdout == expstdout
with open('my_stdout', 'wt') as stdoutf:
stdout = run.run('./script.sh 1 2 3',
log={'cmd' : stdoutf})
assert stdout == expstdout
assert open('my_stdout', 'rt').read() == expcmd
with open('my_stdout', 'wt') as stdoutf:
stdout = run.run('./script.sh 1 2 3',
log={'cmd' : True, 'stdout' : stdoutf})
log={'cmd' : stdoutf, "stdout" : stdoutf})
assert stdout == expstdout
assert open('my_stdout', 'rt').read() == expstdout
assert open('my_stdout', 'rt').read() == expcmd + expstdout
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment