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

Function test_llm_autosuggestion

tests/test_shortcuts.py:50–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48@dec.skip_without("jupyter_ai")
49@pytest.mark.asyncio
50async def test_llm_autosuggestion():
51 provider = NavigableAutoSuggestFromHistory()
52 ip = get_ipython()
53 ip.auto_suggest = provider
54 ip.llm_provider_class = "tests.fake_llm.FibonacciCompletionProvider"
55 ip.history_manager.get_range = Mock(return_value=[])
56 text = "def fib"
57 event = Mock()
58 event.current_buffer = Buffer(
59 history=PtkHistoryAdapter(ip),
60 )
61 event.current_buffer.insert_text(text, move_cursor=True)
62 await llm_autosuggestion(event)
63 assert event.current_buffer.suggestion.text == FIBONACCI[len(text) :]
64
65
66def test_slow_llm_provider_should_not_block_init():

Callers

nothing calls this directly

Calls 4

PtkHistoryAdapterClass · 0.90
llm_autosuggestionFunction · 0.90
get_ipythonFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…