From a1afa7cc454c476280dda3201e8ed21d4fce9dfd Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Sun, 10 Mar 2019 13:44:39 -0400 Subject: Added function to report that a disabled command has been run. Not adding disabled commands to the history when run. --- tests/test_cmd2.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/test_cmd2.py') 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) -- cgit v1.2.1