Skip to content

Commit 7944147

Browse files
authored
Merge pull request #429 from python-cmd2/rlutils_unit_tests
Added a unit test to help better cover rl_utils.py
2 parents 19ebad9 + 1b67db0 commit 7944147

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_cmd2.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,3 +1739,12 @@ def test_parseline(base_app):
17391739
assert command == 'command'
17401740
assert args == "with 'partially completed quotes"
17411741
assert line == statement.strip()
1742+
1743+
1744+
def test_readline_remove_history_item(base_app):
1745+
from cmd2.rl_utils import readline
1746+
assert readline.get_current_history_length() == 0
1747+
readline.add_history('this is a test')
1748+
assert readline.get_current_history_length() == 1
1749+
readline.remove_history_item(0)
1750+
assert readline.get_current_history_length() == 0

0 commit comments

Comments
 (0)