

def _trycompletions_inner(self, inputstring, immediate='', choices=(), other_choices_ok=False, split_completed_lines=True):
    "\n        Test tab completion in cqlsh. Enters in the text in inputstring, then\n        simulates a tab keypress to see what is immediately completed (this\n        should only happen when there is only one completion possible). If\n        there is an immediate completion, the new text is expected to match\n        'immediate'. If there is no immediate completion, another tab keypress\n        is simulated in order to get a list of choices, which are expected to\n        match the items in 'choices' (order is not important, but case is).\n        "
    completed = self._get_completions(inputstring, split_completed_lines=split_completed_lines)
    if immediate:
        msg = ('cqlsh completed %r, but we expected %r' % (completed, immediate))
        self.assertEqual(completed, immediate, msg=msg)
        return
    if other_choices_ok:
        self.assertEqual(set(choices), completed.intersection(choices))
    else:
        self.assertEqual(set(choices), set(completed))

dataset/ETHPy150Open francelabs/datafari/cassandra/pylib/cqlshlib/test/test_cqlsh_completion.py CqlshCompletionCase._trycompletions_inner/original