diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-25 14:12:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-25 14:12:22 -0400 |
commit | 38aed327422e043370a92e82ed0e56381885f60e (patch) | |
tree | 88281b4a47a30cd584c9ce2d4e3429a611e0b549 /tests/test_cmd2.py | |
parent | 79689b22b211f3387ee0475a448e2c6006978cff (diff) | |
parent | 38f070a5876e91945bfadd3fe60ddcb8b21b96c3 (diff) | |
download | cmd2-git-38aed327422e043370a92e82ed0e56381885f60e.tar.gz |
Merge branch 'master' into alert_printer
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 10c60d71..f3ec29dc 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -993,10 +993,13 @@ def test_cmdloop_without_rawinput(): class HookFailureApp(cmd2.Cmd): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + # register a postparsing hook method + self.register_postparsing_hook(self.postparsing_precmd) - def postparsing_precmd(self, statement): + def postparsing_precmd(self, data: cmd2.plugin.PostparsingData) -> cmd2.plugin.PostparsingData: """Simulate precmd hook failure.""" - return True, statement + data.stop = True + return data @pytest.fixture def hook_failure(): |