def test_iter_action_completions_does_not_yield_if_no_completable_parameters_provided(
    completer: ActionCompleter,
    action: types.Action,
    fragments: List[str],
    complete_event: CompleteEvent,
    start_position: int,
):
    completions = completer._iter_action_completions(
        action, fragments, complete_event, start_position=start_position)
    assert len(list(completions)) == 0
def test_iter_action_completions(
    completer: ActionCompleter,
    action: types.Action,
    complete_event: CompleteEvent,
    start_position: int,
):
    completions = completer._iter_action_completions(
        action, [""], complete_event, start_position=start_position)
    assert len(list(completions)) > 0
    assert all(completion.start_position == start_position
               for completion in completions)
def test_iter_action_completions_does_not_yield_if_no_source_completion_iterator(
    completer: ActionCompleter,
    action: types.Action,
    fragments: List[str],
    complete_event: CompleteEvent,
    start_position: int,
):

    # XXX: this test is dependent that we don't ever attempt to complete for integers as
    # a parameter source in the future
    completions = completer._iter_action_completions(
        action, fragments, complete_event, start_position=start_position)
    assert len(list(completions)) == 0