MCPcopy Index your code
hub / github.com/ipython/ipython / test_navigable_provider_multiline_entries

Function test_navigable_provider_multiline_entries

tests/test_shortcuts.py:316–351  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

314
315@pytest.mark.asyncio
316async def test_navigable_provider_multiline_entries():
317 provider = NavigableAutoSuggestFromHistory()
318 history = InMemoryHistory(history_strings=["very_a\nvery_b", "very_c"])
319 buffer = Buffer(history=history)
320 ip = get_ipython()
321 ip.auto_suggest = provider
322
323 async for _ in history.load():
324 pass
325
326 buffer.cursor_position = 5
327 buffer.text = "very"
328 up = swap_autosuggestion_up
329 down = swap_autosuggestion_down
330
331 event = Mock()
332 event.current_buffer = buffer
333
334 def get_suggestion():
335 suggestion = provider.get_suggestion(buffer, buffer.document)
336 buffer.suggestion = suggestion
337 return suggestion
338
339 assert get_suggestion().text == "_c"
340
341 up(event)
342 assert get_suggestion().text == "_b"
343
344 up(event)
345 assert get_suggestion().text == "_a"
346
347 down(event)
348 assert get_suggestion().text == "_b"
349
350 down(event)
351 assert get_suggestion().text == "_c"
352
353
354def create_session_mock():

Callers

nothing calls this directly

Calls 4

get_suggestionFunction · 0.85
loadMethod · 0.80
get_ipythonFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…