summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-25 14:15:02 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-25 14:15:02 -0400
commitd3c8efdc5a9fe8a57139f19270aee1be794ec299 (patch)
treec976282f07609d489bbe4a98cee2f5d3cc87164f /tests/test_cmd2.py
parentb5780366e7421c928a2438530017a4a203a1408b (diff)
parent38f070a5876e91945bfadd3fe60ddcb8b21b96c3 (diff)
downloadcmd2-git-d3c8efdc5a9fe8a57139f19270aee1be794ec299.tar.gz
Merged master and resolved conflicts in CHANGELOG
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 91fb8b39..92832e2f 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -989,10 +989,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():