summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-08-22 13:22:53 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-08-22 13:22:53 -0400
commit6af36b1753e0f70597def2210bd2b1279a44c188 (patch)
treed969ba525dc6040eeeef154809f2342be4a2b329 /tests
parentf1bf0ae07769630977f803ef685ce41d68cdfe6a (diff)
downloadcmd2-git-6af36b1753e0f70597def2210bd2b1279a44c188.tar.gz
AutoCompleter now passes parsed_args to all choices and completer functions
Diffstat (limited to 'tests')
-rw-r--r--tests/test_argparse_completer.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_argparse_completer.py b/tests/test_argparse_completer.py
index 2a94c1d8..fb063659 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() -> List[str]:
+def choices_function(**_kwargs) -> List[str]:
"""Function that provides choices"""
return choices_from_function
-def completer_function(text: str, line: str, begidx: int, endidx: int) -> List[str]:
+def completer_function(text: str, line: str, begidx: int, endidx: int, **_kwargs) -> 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) -> List[str]:
+ def choices_method(self, **_kwargs) -> List[str]:
"""Method that provides choices"""
return choices_from_method
- def completion_item_method(self) -> List[CompletionItem]:
+ def completion_item_method(self, **_kwargs) -> 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) -> List[str]:
+ def completer_method(self, text: str, line: str, begidx: int, endidx: int, **_kwargs) -> List[str]:
"""Tab completion method"""
return basic_complete(text, line, begidx, endidx, completions_from_method)