Test that no delimiter is added when an item has been fully completed
(cmd2_app)
| 656 | |
| 657 | |
| 658 | def test_delimiter_completion_full(cmd2_app) -> None: |
| 659 | """Test that no delimiter is added when an item has been fully completed""" |
| 660 | text = "/home/other user/" |
| 661 | line = f"command {text}" |
| 662 | endidx = len(line) |
| 663 | begidx = endidx - len(text) |
| 664 | |
| 665 | # No matches end with the delimiter |
| 666 | expected_items = [ |
| 667 | CompletionItem("/home/other user/maps", display="maps"), |
| 668 | CompletionItem("/home/other user/tests", display="tests"), |
| 669 | ] |
| 670 | expected_completions = Completions(expected_items) |
| 671 | completions = cmd2_app.delimiter_complete(text, line, begidx, endidx, delimited_strs, "/") |
| 672 | |
| 673 | assert completions.to_strings() == expected_completions.to_strings() |
| 674 | assert [item.display for item in completions] == [item.display for item in expected_completions] |
| 675 | |
| 676 | |
| 677 | def test_delimiter_completion_nomatch(cmd2_app) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…