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

Function test_onecmd_add_to_history

tests/test_cmd2.py:3544–3558  ·  view source on GitHub ↗
(outsim_app)

Source from the content-addressed store, hash-verified

3542
3543
3544def test_onecmd_add_to_history(outsim_app) -> None:
3545 line = "help"
3546 saved_hist_len = len(outsim_app.history)
3547
3548 # Allow command to be added to history
3549 outsim_app.onecmd(line, add_to_history=True)
3550 new_hist_len = len(outsim_app.history)
3551 assert new_hist_len == saved_hist_len + 1
3552
3553 saved_hist_len = new_hist_len
3554
3555 # Prevent command from being added to history
3556 outsim_app.onecmd(line, add_to_history=False)
3557 new_hist_len = len(outsim_app.history)
3558 assert new_hist_len == saved_hist_len
3559
3560
3561def test_get_all_commands(base_app) -> None:

Callers

nothing calls this directly

Calls 1

onecmdMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…