def test_index_based_completion_syntax_err(): text = 'Foo' line = 'command "Pizza Foo' endidx = len(line) begidx = endidx - len(text) assert index_based_complete(text, line, begidx, endidx, index_dict) == []
def test_index_based_completion_multiple(): text = '' line = 'command Pizza ' endidx = len(line) begidx = endidx - len(text) assert index_based_complete(text, line, begidx, endidx, index_dict) == sorted(sport_item_strs)
def test_index_based_completion_single_mid(): text = 'Foo' line = 'command Pizza Foo' begidx = len(line) - len(text) endidx = begidx + 1 assert index_based_complete(text, line, begidx, endidx, index_dict) == ['Football']
def test_index_based_callable_completer(request): test_dir = os.path.dirname(request.module.__file__) text = 'c' path = os.path.join(test_dir, text) line = 'command Pizza Bat {}'.format(path) endidx = len(line) begidx = endidx - len(text) assert index_based_complete(text, line, begidx, endidx, index_dict) == ['conftest.py ']
def test_index_based_completion_nomatch(): text = 'q' line = 'command q' endidx = len(line) begidx = endidx - len(text) assert index_based_complete(text, line, begidx, endidx, index_dict) == []