diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-08-27 00:24:29 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-08-27 00:24:29 -0400 |
commit | 33adefc98a07c8d2d0617076de29c52dbd3b4e19 (patch) | |
tree | 1ef18d9536345c21326c9044b8471361c75edc72 /tests/test_argparse_completer.py | |
parent | 6af36b1753e0f70597def2210bd2b1279a44c188 (diff) | |
download | cmd2-git-33adefc98a07c8d2d0617076de29c52dbd3b4e19.tar.gz |
AutoCompleter only passes parsed_args to choices/completer functions that have an argument called 'parsed_args'
Diffstat (limited to 'tests/test_argparse_completer.py')
-rw-r--r-- | tests/test_argparse_completer.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_argparse_completer.py b/tests/test_argparse_completer.py index fb063659..2a94c1d8 100644 --- a/tests/test_argparse_completer.py +++ b/tests/test_argparse_completer.py @@ -31,12 +31,12 @@ completions_from_function = ['completions', 'function', 'fairly', 'complete'] completions_from_method = ['completions', 'method', 'missed', 'spot'] -def choices_function(**_kwargs) -> List[str]: +def choices_function() -> List[str]: """Function that provides choices""" return choices_from_function -def completer_function(text: str, line: str, begidx: int, endidx: int, **_kwargs) -> List[str]: +def completer_function(text: str, line: str, begidx: int, endidx: int) -> List[str]: """Tab completion function""" return basic_complete(text, line, begidx, endidx, completions_from_function) @@ -123,11 +123,11 @@ class AutoCompleteTester(cmd2.Cmd): ############################################################################################################ # Begin code related to testing choices, choices_function, and choices_method parameters ############################################################################################################ - def choices_method(self, **_kwargs) -> List[str]: + def choices_method(self) -> List[str]: """Method that provides choices""" return choices_from_method - def completion_item_method(self, **_kwargs) -> List[CompletionItem]: + def completion_item_method(self) -> List[CompletionItem]: """Choices method that returns CompletionItems""" items = [] for i in range(0, 10): @@ -164,7 +164,7 @@ class AutoCompleteTester(cmd2.Cmd): ############################################################################################################ # Begin code related to testing completer_function and completer_method parameters ############################################################################################################ - def completer_method(self, text: str, line: str, begidx: int, endidx: int, **_kwargs) -> List[str]: + def completer_method(self, text: str, line: str, begidx: int, endidx: int) -> List[str]: """Tab completion method""" return basic_complete(text, line, begidx, endidx, completions_from_method) |