diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-10 13:44:39 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-10 13:44:39 -0400 |
commit | a1afa7cc454c476280dda3201e8ed21d4fce9dfd (patch) | |
tree | 2fdb4fa7337bb94ce5ab59ad815572017261f74a /tests/test_cmd2.py | |
parent | c5872ac9ffa9047087340fe340b8a88bf2a902d6 (diff) | |
download | cmd2-git-a1afa7cc454c476280dda3201e8ed21d4fce9dfd.tar.gz |
Added function to report that a disabled command has been run.
Not adding disabled commands to the history when run.
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 5e9e4ce6..b3942203 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -2267,3 +2267,11 @@ def test_disable_command_twice(disable_commands_app): disable_commands_app.disable_command('has_help_func', message_to_print) new_len = len(disable_commands_app.disabled_commands) assert saved_len == new_len + +def test_disabled_command_not_in_history(disable_commands_app): + message_to_print = 'These commands are currently disabled' + disable_commands_app.disable_command('has_help_func', message_to_print) + + saved_len = len(disable_commands_app.history) + run_cmd(disable_commands_app, 'has_help_func') + assert saved_len == len(disable_commands_app.history) |