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

Function test_plain_fields

tests/test_completion.py:953–963  ·  view source on GitHub ↗

Test the plain text fields in CompletionItem.

()

Source from the content-addressed store, hash-verified

951
952
953def test_plain_fields() -> None:
954 """Test the plain text fields in CompletionItem."""
955 display = "\x1b[31mApple\x1b[0m"
956 display_meta = "\x1b[32mA tasty apple\x1b[0m"
957
958 # Show that the plain fields remove the ANSI sequences.
959 completion_item = CompletionItem("apple", display=display, display_meta=display_meta)
960 assert completion_item.display == display
961 assert completion_item.display_plain == "Apple"
962 assert completion_item.display_meta == display_meta
963 assert completion_item.display_meta_plain == "A tasty apple"
964
965
966def test_clean_display() -> None:

Callers

nothing calls this directly

Calls 1

CompletionItemClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…