File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -576,6 +576,21 @@ def test_pipe_to_shell(base_app):
576576 out , err = run_cmd (base_app , command )
577577 assert out and not err
578578
579+ def test_pipe_to_shell_and_redirect (base_app ):
580+ filename = 'out.txt'
581+ if sys .platform == "win32" :
582+ # Windows
583+ command = 'help | sort > {}' .format (filename )
584+ else :
585+ # Mac and Linux
586+ # Get help on help and pipe it's output to the input of the word count shell command
587+ command = 'help help | wc > {}' .format (filename )
588+
589+ out , err = run_cmd (base_app , command )
590+ assert not out and not err
591+ assert os .path .exists (filename )
592+ os .remove (filename )
593+
579594def test_pipe_to_shell_error (base_app ):
580595 # Try to pipe command output to a shell command that doesn't exist in order to produce an error
581596 out , err = run_cmd (base_app , 'help | foobarbaz.this_does_not_exist' )
You can’t perform that action at this time.
0 commit comments