diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-14 19:49:09 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-14 19:49:09 -0400 |
commit | 27d5785651d053b7c4204155897ec03d21f71639 (patch) | |
tree | 1200400e29751eaecbf11fba8789939ffd7063ff /tests/test_history.py | |
parent | 547d4b83cf161ea8aeb275768f3284c7a751fa9a (diff) | |
download | cmd2-git-27d5785651d053b7c4204155897ec03d21f71639.tar.gz |
Added a unit test for HistoryItem.pr() in the case of non-verbose, non-expanded multiline commands
Also:
- Updated CHANGELOG to reflect that 0.9.13 release is planned for June 2019
Diffstat (limited to 'tests/test_history.py')
-rw-r--r-- | tests/test_history.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_history.py b/tests/test_history.py index ce915d1a..a06bce87 100644 --- a/tests/test_history.py +++ b/tests/test_history.py @@ -289,6 +289,18 @@ def test_multiline_histitem(parser): assert len(history) == 1 hist_item = history[0] assert hist_item.raw == line + pr_lines = hist_item.pr().splitlines() + assert pr_lines[0].endswith('multiline foo bar') + +def test_multiline_histitem_verbose(parser): + from cmd2.history import History + line = 'multiline foo\nbar\n\n' + statement = parser.parse(line) + history = History() + history.append(statement) + assert len(history) == 1 + hist_item = history[0] + assert hist_item.raw == line pr_lines = hist_item.pr(verbose=True).splitlines() assert pr_lines[0].endswith('multiline foo') assert pr_lines[1] == 'bar' |