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

Function test_base_history

tests/test_history.py:495–523  ·  view source on GitHub ↗
(base_app)

Source from the content-addressed store, hash-verified

493# test history command
494#
495def test_base_history(base_app) -> None:
496 run_cmd(base_app, "help")
497 run_cmd(base_app, "shortcuts")
498 out, _err = run_cmd(base_app, "history")
499 expected = normalize(
500 """
501 1 help
502 2 shortcuts
503"""
504 )
505 assert out == expected
506
507 out, _err = run_cmd(base_app, "history he")
508 expected = normalize(
509 """
510 1 help
511"""
512 )
513 assert out == expected
514 verify_hi_last_result(base_app, 1)
515
516 out, _err = run_cmd(base_app, "history sh")
517 expected = normalize(
518 """
519 2 shortcuts
520"""
521 )
522 assert out == expected
523 verify_hi_last_result(base_app, 1)
524
525
526def test_history_script_format(base_app) -> None:

Callers

nothing calls this directly

Calls 3

run_cmdFunction · 0.85
normalizeFunction · 0.85
verify_hi_last_resultFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…