From 33adefc98a07c8d2d0617076de29c52dbd3b4e19 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Tue, 27 Aug 2019 00:24:29 -0400 Subject: AutoCompleter only passes parsed_args to choices/completer functions that have an argument called 'parsed_args' --- tests/test_argparse_completer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/test_argparse_completer.py') 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) -- cgit v1.2.1