summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-08-21 22:56:05 -0400
committerGitHub <noreply@github.com>2018-08-21 22:56:05 -0400
commit3234833c462bd0817f55b8a8145c99347765e77b (patch)
treec2790e1b3f008a0968a1d00f34ccefe26c2e2102 /tests/test_cmd2.py
parent551f635ae14b814be6855e9ac8198216ad3a089c (diff)
parent6d74e51aeb769033f1ce8657b8570fb2e167ed8a (diff)
downloadcmd2-git-3234833c462bd0817f55b8a8145c99347765e77b.tar.gz
Merge pull request #501 from python-cmd2/all_commands
Make sure get_all_commands() returns functions
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