def test_iter_basic_param_completions_invalid_value( completer: ActionCompleter, action: types.Action, action_param: types.ActionParam, param_value: str, complete_event: CompleteEvent, start_position: int, ): assert (len( list( completer._iter_basic_param_completions( action, action_param, param_value, complete_event, start_position=start_position, ))) == 0)
def test_iter_basic_param_completions( completer: ActionCompleter, action: types.Action, action_param: types.ActionParam, complete_event: CompleteEvent, start_position: int, ): completions = list( completer._iter_basic_param_completions( action, action_param, action_param.source, # type: ignore complete_event, start_position=start_position, )) assert len(completions) == 1 first_completion, *_ = completions assert first_completion.text == action_param.source assert first_completion.start_position == start_position