summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-08-21 21:46:53 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-08-21 21:46:53 -0400
commit4db8dc3c0ebb7d56abc9ccf0f37f501d0a03a170 (patch)
tree1049700ccb2a62c266ad95b8834cdb4dc0726584 /tests/test_cmd2.py
parentfe83dc063216e80c99e4e429494d56e36d4dc055 (diff)
downloadcmd2-git-4db8dc3c0ebb7d56abc9ccf0f37f501d0a03a170.tar.gz
Updated changelog
Also: - Added unit tests for get_all_commands() and get_help_topcis() methods
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 0ec993e9..d9ef5e78 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -1916,3 +1916,17 @@ def test_bad_history_file_path(capsys, request):
else:
# GNU readline raises an exception upon trying to read the directory as a file
assert 'readline cannot read' in err
+
+
+
+def test_get_all_commands(base_app):
+ # Verify that the base app has the expected commands
+ commands = base_app.get_all_commands()
+ expected_commands = ['_relative_load', 'alias', 'edit', 'eof', 'eos', 'help', 'history', 'load', 'py', 'pyscript',
+ 'quit', 'set', 'shell', 'shortcuts', 'unalias']
+ assert commands == expected_commands
+
+def test_get_help_topics(base_app):
+ # Verify that the base app has no additional help_foo methods
+ custom_help = base_app.get_help_topics()
+ assert len(custom_help) == 0