def _trycompletions_inner(self, inputstring, immediate='', choices=(),
                              other_choices_ok=False,
                              split_completed_lines=True):
        """
        Test tab completion in cqlsh. Enters in the text in inputstring, then
        simulates a tab keypress to see what is immediately completed (this
        should only happen when there is only one completion possible). If
        there is an immediate completion, the new text is expected to match
        'immediate'. If there is no immediate completion, another tab keypress
        is simulated in order to get a list of choices, which are expected to
        match the items in 'choices' (order is not important, but case is).
        """
        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