(capsys)
| 485 | |
| 486 | |
| 487 | def 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 | |
| 508 | def test_postparsing_hook_emptystatement_second(capsys) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…