()
| 314 | |
| 315 | @pytest.mark.asyncio |
| 316 | async 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 | |
| 354 | def create_session_mock(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…