()
| 48 | @dec.skip_without("jupyter_ai") |
| 49 | @pytest.mark.asyncio |
| 50 | async 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 | |
| 66 | def test_slow_llm_provider_should_not_block_init(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…