summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-01-29 22:26:00 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2017-01-29 22:26:00 -0500
commitf182c7ad46b72bae377265a5c67468d2d52c3f27 (patch)
tree1aa87964967a5117ef208b843e7f1597d598186b /tests/test_cmd2.py
parent9c8056f03ff0e6fac515d9b8defff68a5eeef454 (diff)
downloadcmd2-git-f182c7ad46b72bae377265a5c67468d2d52c3f27.tar.gz
Added unit test for cmdenvironment command
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index a6a3822e..2005f678 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -181,3 +181,22 @@ def test_base_load(base_app):
assert m.called
m.assert_called_once_with('myfname')
# TODO: Figure out how to check stdout or stderr during a do_load()
+
+
+def test_base_cmdenvironment(base_app):
+ out = run_cmd(base_app, 'cmdenvironment')
+ expected = _normalize("""
+
+ Commands are not case-sensitive.
+ Commands may be terminated with: [';']
+""")
+ assert out[:2] == expected[:2]
+ assert out[2].strip().startswith('Settable parameters: ')
+
+ # Settable parameters can be listed in any order, so need to validate carefully using unordered sets
+ settable_params = set(['continuation_prompt', 'default_file_name', 'prompt', 'abbrev', 'quiet',
+ 'case_insensitive', 'colors', 'echo', 'timing', 'editor',
+ 'feedback_to_output', 'debug'])
+ out_params = set(out[2].split("Settable parameters: ")[1].split())
+
+ assert settable_params == out_params