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

Function test_single_prefix_char

tests/test_argparse_completer.py:1074–1090  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1072
1073
1074def test_single_prefix_char() -> None:
1075 from cmd2.argparse_completer import (
1076 _single_prefix_char,
1077 )
1078
1079 parser = Cmd2ArgumentParser(prefix_chars="-+")
1080
1081 # Invalid
1082 assert not _single_prefix_char("", parser)
1083 assert not _single_prefix_char("--", parser)
1084 assert not _single_prefix_char("-+", parser)
1085 assert not _single_prefix_char("++has space", parser)
1086 assert not _single_prefix_char("foo", parser)
1087
1088 # Valid
1089 assert _single_prefix_char("-", parser)
1090 assert _single_prefix_char("+", parser)
1091
1092
1093def test_looks_like_flag() -> None:

Callers

nothing calls this directly

Calls 2

Cmd2ArgumentParserClass · 0.90
_single_prefix_charFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…