MCPcopy Create free account
hub / github.com/python-cmd2/cmd2 / test_tokens_for_completion_punctuation

Function test_tokens_for_completion_punctuation

tests/test_completion.py:715–727  ·  view source on GitHub ↗

Test that redirectors and terminators are word delimiters

(cmd2_app)

Source from the content-addressed store, hash-verified

713
714
715def test_tokens_for_completion_punctuation(cmd2_app) -> None:
716 """Test that redirectors and terminators are word delimiters"""
717 text = "file"
718 line = f"command | < ;>>{text}"
719 endidx = len(line)
720 begidx = endidx - len(text)
721
722 expected_tokens = ["command", "|", "<", ";", ">>", "file"]
723 expected_raw_tokens = ["command", "|", "<", ";", ">>", "file"]
724
725 tokens, raw_tokens = cmd2_app.tokens_for_completion(line, begidx, endidx)
726 assert expected_tokens == tokens
727 assert expected_raw_tokens == raw_tokens
728
729
730def test_tokens_for_completion_quoted_punctuation(cmd2_app) -> None:

Callers

nothing calls this directly

Calls 1

tokens_for_completionMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…