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

Function test_postparsing_hook_stop_first

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

Source from the content-addressed store, hash-verified

448
449
450def test_postparsing_hook_stop_first(capsys) -> None:
451 app = PluggedApp()
452 app.register_postparsing_hook(app.postparse_hook_stop)
453 stop = app.onecmd_plus_hooks("say hello")
454 assert app.called_postparsing == 1
455 assert stop
456
457 # register another function but it shouldn't be called
458 app.reset_counters()
459 app.register_postparsing_hook(app.postparse_hook)
460 stop = app.onecmd_plus_hooks("say hello")
461 assert app.called_postparsing == 1
462 assert stop
463
464
465def test_postparsing_hook_stop_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…