summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-06-04 10:20:31 -0700
committerGitHub <noreply@github.com>2018-06-04 10:20:31 -0700
commit794414745f7c28c4c96300117ce9a57c38d4d5b5 (patch)
tree22a2ea1792154511ad03fe12c070440658244b0a
parent19ebad944a1dd6ac7445d22dfc51e217941ea770 (diff)
parent1b67db04f8273471b51f5374364fa93a0b0f384e (diff)
downloadcmd2-git-794414745f7c28c4c96300117ce9a57c38d4d5b5.tar.gz
Merge pull request #429 from python-cmd2/rlutils_unit_tests
Added a unit test to help better cover rl_utils.py
-rw-r--r--tests/test_cmd2.py9
1 files changed, 9 insertions, 0 deletions
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