summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-07-01 15:42:55 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2017-07-01 15:42:55 -0400
commit94cf4a12b112d5a3b4890bebde0a4dc40a815fcd (patch)
tree031f434ac2f5ca1111aa8b0693abae9046f2196c /tests/test_cmd2.py
parenta4ded9f08ba41a04b9944ee1f92ca276c56fde23 (diff)
downloadcmd2-git-94cf4a12b112d5a3b4890bebde0a4dc40a815fcd.tar.gz
Added some more tests for path completion and shell command completion
Also: - Added a test for do_pause - Cleaned up a bunch of magic numbers from existing test for shell and path command completion
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 03cab912..7e9769e3 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -148,6 +148,14 @@ def test_base_error(base_app):
assert out == ["*** Unknown syntax: meow"]
+def test_base_pause(base_app):
+ # Mock out the input call so we don't actually wait for a user's response on stdin
+ m = mock.MagicMock(name='input', return_value='\n')
+ sm.input = m
+
+ run_cmd(base_app, 'pause')
+ m.assert_called_once()
+
def test_base_history(base_app):
run_cmd(base_app, 'help')
run_cmd(base_app, 'shortcuts')