summaryrefslogtreecommitdiff
path: root/tests/test_plugin.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2018-06-03 12:53:05 -0600
committerkotfu <kotfu@kotfu.net>2018-06-03 12:53:05 -0600
commite5a0f306a16bb06406ba3c6f88821bfe6c8ca738 (patch)
tree86d8ecf0839491b7fa29629326886aa9fe0b366b /tests/test_plugin.py
parenteaf7415f010ab82688a0a30627a0efa2419f2837 (diff)
downloadcmd2-git-e5a0f306a16bb06406ba3c6f88821bfe6c8ca738.tar.gz
Begin converting precmd to passing and returning a data object
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 2bebd4af..133284a0 100644
--- a/tests/test_plugin.py
+++ b/tests/test_plugin.py
@@ -11,6 +11,7 @@ from typing import Tuple
import pytest
import cmd2
+from cmd2 import plugin
from .conftest import StdOut
@@ -57,10 +58,10 @@ class Plugin:
self.called_precmd += 1
return statement
- def precmd_hook(self, statement: cmd2.Statement) -> cmd2.Statement:
+ def precmd_hook(self, data: plugin.PrecommandData) -> plugin.PrecommandData:
"A precommand hook"
self.called_precmd += 1
- return statement
+ return data
def precmd_hook_emptystatement(self, statement: cmd2.Statement) -> cmd2.Statement:
"A precommand hook which raises an EmptyStatement exception"