summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-06-29 15:35:13 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2017-06-29 15:35:13 -0400
commit4ed2f013709bd7ca196b68bebbe1b3f8d961699d (patch)
tree4d2419a755d6a6ea861958f27725098c7fc2198c /tests/test_cmd2.py
parent246a05c3411692ac8bffdcccecb09e434b5fcb53 (diff)
downloadcmd2-git-4ed2f013709bd7ca196b68bebbe1b3f8d961699d.tar.gz
Made output pipe to shell command featuer much more reliable
The ability to pipe the output of a cmd2 command to a shell command no longer depends on the presence of the "cat" shell command. It now directly pipes the contents of a file as the stdin to the shell command.
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index adf47d31..efc82294 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -402,15 +402,22 @@ def test_input_redirection(base_app, request):
def test_pipe_to_shell(base_app):
- # Get help on help and pipe it's output to the input of the word count shell command
- out = run_cmd(base_app, 'help help | wc')
-
if sys.platform == "win32":
- expected = normalize("1 11 71")
+ # Windows
+ # Get help menu and pipe it's output to the sort shell command
+ out = run_cmd(base_app, 'help | sort')
+ expected = normalize("""
+_relative_load edit history pause pyscript run set shortcuts
+========================================
+cmdenvironment help load py quit save shell show
+Documented commands (type help <topic>):""")
+ assert out == expected
else:
- expected = normalize("1 11 70")
-
- assert out[0].strip() == expected[0].strip()
+ # Mac and Linux
+ # Get help on help and pipe it's output to the input of the word count shell command
+ out = run_cmd(base_app, 'help help | wc')
+ expected = normalize("1 11 70")
+ assert out[0].strip() == expected[0].strip()
def test_send_to_paste_buffer(base_app):