MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_delimiter_completion_full

Function test_delimiter_completion_full

tests/test_completion.py:658–674  ·  view source on GitHub ↗

Test that no delimiter is added when an item has been fully completed

(cmd2_app)

Source from the content-addressed store, hash-verified

656
657
658def 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
677def test_delimiter_completion_nomatch(cmd2_app) -> None:

Callers

nothing calls this directly

Calls 4

CompletionItemClass · 0.90
CompletionsClass · 0.90
delimiter_completeMethod · 0.80
to_stringsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…