(app)
| 32 | |
| 33 | |
| 34 | def test_dynamic_complete_style(app): |
| 35 | # Cmd.complete() interacts with app.active_session. |
| 36 | # Set it here since it's normally set when the prompt is created. |
| 37 | app.active_session: PromptSession[str] = PromptSession( |
| 38 | input=app.main_session.input, |
| 39 | output=app.main_session.output, |
| 40 | ) |
| 41 | |
| 42 | # Default max_column_completion_results is 7 |
| 43 | assert app.max_column_completion_results == 7 |
| 44 | |
| 45 | # Complete 'foo' which has 10 items (> 7) |
| 46 | # text='item', state=0, line='foo item', begidx=4, endidx=8 |
| 47 | app.complete("item", "foo item", 4, 8) |
| 48 | assert app.active_session.complete_style == CompleteStyle.MULTI_COLUMN |
| 49 | |
| 50 | # Complete 'bar' which has 5 items (<= 7) |
| 51 | app.complete("item", "bar item", 4, 8) |
| 52 | assert app.active_session.complete_style == CompleteStyle.COLUMN |
| 53 | |
| 54 | |
| 55 | def test_dynamic_complete_style_custom_limit(app): |
nothing calls this directly
no test coverage detected
searching dependent graphs…