summaryrefslogtreecommitdiff
path: root/tests/test_plugin.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-25 00:10:13 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-25 00:10:13 -0400
commit67aa13c732b331e700c8bd16c77fabfe6c90c75c (patch)
treeb7bb35ca64b16ee79b8070ceb29dda7f0269d729 /tests/test_plugin.py
parent3c51b9f32d35c05847c302646575dab576430a01 (diff)
downloadcmd2-git-67aa13c732b331e700c8bd16c77fabfe6c90c75c.tar.gz
Deleted the hook methods which were deprecated in the previous release
The following methods of cmd2.Cmd have been deleted: - preparse - postparsing_precmd - postparsing_postcmd The new application lifecycle hook framework allows for registering callbacks to be called at various points in the application lifecycle and is more powerful and flexible than the old system of fixed hook methods.
Diffstat (limited to 'tests/test_plugin.py')
-rw-r--r--tests/test_plugin.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_plugin.py b/tests/test_plugin.py
index 20f2f32c..81dd7683 100644
--- a/tests/test_plugin.py
+++ b/tests/test_plugin.py
@@ -51,10 +51,10 @@ class Plugin:
# preparse hook
#
###
- def preparse(self, line: str) -> str:
+ def preparse(self, data: cmd2.plugin.PostparsingData) -> cmd2.plugin.PostparsingData:
"""Preparsing hook"""
self.called_preparse += 1
- return line
+ return data
###
#
@@ -322,6 +322,7 @@ def test_postloop_hooks(capsys):
###
def test_preparse(capsys):
app = PluggedApp()
+ app.register_postparsing_hook(app.preparse)
app.onecmd_plus_hooks('say hello')
out, err = capsys.readouterr()
assert out == 'hello\n'