From a803f4cba59e98adaee0f488a3b103b6c61fc9cc Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Thu, 31 May 2018 22:07:34 -0700 Subject: Added a unit test to help better cover rl_utils.py --- tests/test_cmd2.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/test_cmd2.py') diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 68aa0b98..24a14ea2 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -1739,3 +1739,12 @@ def test_parseline(base_app): assert command == 'command' assert args == "with 'partially completed quotes" assert line == statement.strip() + + +def test_readline_remove_history_item(base_app): + from cmd2.rl_utils import readline + assert readline.get_current_history_length() == 0 + readline.add_history('this is a test') + assert readline.get_current_history_length() == 1 + readline.remove_history_item(0) + assert readline.get_current_history_length() == 0 -- cgit v1.2.1