MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_postparsing_hook_emptystatement_first

Function test_postparsing_hook_emptystatement_first

tests/test_plugin.py:487–505  ·  view source on GitHub ↗
(capsys)

Source from the content-addressed store, hash-verified

485
486
487def test_postparsing_hook_emptystatement_first(capsys) -> None:
488 app = PluggedApp()
489 app.register_postparsing_hook(app.postparse_hook_emptystatement)
490 stop = app.onecmd_plus_hooks("say hello")
491 out, err = capsys.readouterr()
492 assert not stop
493 assert not out
494 assert not err
495 assert app.called_postparsing == 1
496
497 # register another function but it shouldn't be called
498 app.reset_counters()
499 stop = app.register_postparsing_hook(app.postparse_hook)
500 app.onecmd_plus_hooks("say hello")
501 out, err = capsys.readouterr()
502 assert not stop
503 assert not out
504 assert not err
505 assert app.called_postparsing == 1
506
507
508def test_postparsing_hook_emptystatement_second(capsys) -> None:

Callers

nothing calls this directly

Calls 4

PluggedAppClass · 0.85
onecmd_plus_hooksMethod · 0.80
reset_countersMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…