summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-06-29 15:43:22 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2017-06-29 15:43:22 -0400
commitf6b5c61c8f53dba1961f45a71d3192b0d3e1d5da (patch)
tree4e6a134ff46065275db2c147650551302f7df11b /tests/test_cmd2.py
parent4ed2f013709bd7ca196b68bebbe1b3f8d961699d (diff)
downloadcmd2-git-f6b5c61c8f53dba1961f45a71d3192b0d3e1d5da.tar.gz
Fix pipe_to unit test on Mac and Windows
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index efc82294..5417b4ed 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -407,6 +407,8 @@ def test_pipe_to_shell(base_app):
# 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
@@ -416,7 +418,12 @@ Documented commands (type help <topic>):""")
# 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")
+
+ # Mac and Linux wc behave the same when piped from shell, but differently when piped stdin from file directly
+ if sys.platform == 'darwin':
+ expected = normalize("1 11 70")
+ else:
+ expected = normalize("1 11 70")
assert out[0].strip() == expected[0].strip()