MCPcopy Create free account
hub / github.com/python-cmd2/cmd2 / test_multiline_histitem

Function test_multiline_histitem

tests/test_history.py:405–418  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

403
404
405def test_multiline_histitem(parser) -> None:
406 from cmd2.history import (
407 History,
408 )
409
410 line = "multiline foo\nbar\n\n"
411 statement = parser.parse(line)
412 history = History()
413 history.append(statement)
414 assert len(history) == 1
415 hist_item = history[0]
416 assert hist_item.raw == line
417 pr_lines = hist_item.pr(1).splitlines()
418 assert pr_lines[0].endswith("multiline foo bar")
419
420
421def test_multiline_with_quotes_histitem(parser) -> None:

Callers

nothing calls this directly

Calls 4

appendMethod · 0.95
HistoryClass · 0.90
parseMethod · 0.80
prMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…