Skip to content

Commit 74765ef

Browse files
committed
2 parents cf3f8d8 + a3249b4 commit 74765ef

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed
198 KB
Binary file not shown.

tests/test_completion.py

-54
Original file line numberDiff line numberDiff line change
@@ -295,60 +295,6 @@ def test_word_completer_ignore_case():
295295
assert [c.text for c in completions] == ["abc", "aaa"]
296296

297297

298-
# TODO: delete if not needed, implemented for move_cursor() test
299-
def _feed_cli_with_input(
300-
text,
301-
editing_mode=EditingMode.EMACS,
302-
clipboard=None,
303-
history=None,
304-
multiline=False,
305-
check_line_ending=True,
306-
key_bindings=None,
307-
):
308-
if check_line_ending:
309-
assert text.endswith("\r")
310-
311-
with create_pipe_input() as inp:
312-
inp.send_text(text)
313-
session = PromptSession(
314-
input=inp,
315-
output=DummyOutput(),
316-
editing_mode=editing_mode,
317-
history=history,
318-
multiline=multiline,
319-
clipboard=clipboard,
320-
key_bindings=key_bindings,
321-
)
322-
323-
_ = session.prompt()
324-
return session.default_buffer.document, session.app
325-
326-
327-
# TODO: Finish this test to simulate typing
328-
def test_word_completer_move_cursor():
329-
# move_cursor set to true
330-
completer = WordCompleter(["author:", "title()"], move_back_one_space=True)
331-
# prompt_text = prompt(
332-
# "Begin typing author or title to autocomplete: ", completer=completer, complete_while_typing=False
333-
# )
334-
completions = completer.get_completions(Document("ti"), CompleteEvent())
335-
assert [c.text for c in completions] == ["title()"]
336-
337-
"""sys.stdout.write("TESTTITLE")
338-
keyboard.press_and_release("enter")
339-
assert text == "title(TESTTITLE)"""""
340-
341-
keyboard.press_and_release("tab")
342-
result, cli = _feed_cli_with_input("TESTTITLE\r")
343-
keyboard.press_and_release("enter")
344-
assert result.text == "title(TESTTITLE)"
345-
assert cli.current_buffer.text == "title(TESTTITLE)"
346-
347-
"""result, cli = _feed_cli_with_input("ti\tTESTTITLE\r")
348-
assert result.text == "title(TESTTITLE)"
349-
assert cli.current_buffer.text == "title(TESTTITLE)"""""
350-
351-
352298
def test_word_completer_match_middle():
353299
completer = WordCompleter(["abc", "def", "abca"], match_middle=True)
354300
completions = completer.get_completions(Document("bc"), CompleteEvent())

0 commit comments

Comments
 (0)