diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_cmd2.py | 2 | ||||
-rwxr-xr-x | tests/test_completion.py | 8 | ||||
-rw-r--r-- | tests/test_transcript.py | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index f3c44bd4..91815d50 100755 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -214,7 +214,7 @@ def test_set_allow_style(base_app, new_val, is_valid, expected): class OnChangeHookApp(cmd2.Cmd): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.add_settable(utils.Settable('quiet', bool, "my description", onchange_cb=self._onchange_quiet)) + self.add_settable(utils.Settable('quiet', bool, "my description", self, onchange_cb=self._onchange_quiet)) def _onchange_quiet(self, name, old, new) -> None: """Runs when quiet is changed via set command""" diff --git a/tests/test_completion.py b/tests/test_completion.py index 0635bb48..cde77b93 100755 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -67,7 +67,13 @@ class CompletionsExample(cmd2.Cmd): cmd2.Cmd.__init__(self, multiline_commands=['test_multiline']) self.foo = 'bar' self.add_settable( - utils.Settable('foo', str, description="a settable param", completer=CompletionsExample.complete_foo_val) + utils.Settable( + 'foo', + str, + description="a settable param", + settable_object=self, + completer=CompletionsExample.complete_foo_val, + ) ) def do_test_basic(self, args): diff --git a/tests/test_transcript.py b/tests/test_transcript.py index 48c6a792..ccb28740 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -42,7 +42,7 @@ class CmdLineApp(cmd2.Cmd): super().__init__(*args, multiline_commands=['orate'], **kwargs) # Make maxrepeats settable at runtime - self.add_settable(Settable('maxrepeats', int, 'Max number of `--repeat`s allowed')) + self.add_settable(Settable('maxrepeats', int, 'Max number of `--repeat`s allowed', self)) self.intro = 'This is an intro banner ...' |