Skip to content

Commit a803f4c

Browse files
committed
Added a unit test to help better cover rl_utils.py
1 parent 9852270 commit a803f4c

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)