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

Function test_looks_like_flag

tests/test_argparse_completer.py:1093–1110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1091
1092
1093def test_looks_like_flag() -> None:
1094 from cmd2.argparse_completer import (
1095 _looks_like_flag,
1096 )
1097
1098 parser = Cmd2ArgumentParser()
1099
1100 # Does not start like a flag
1101 assert not _looks_like_flag("", parser)
1102 assert not _looks_like_flag("non-flag", parser)
1103 assert not _looks_like_flag("-", parser)
1104 assert not _looks_like_flag("--has space", parser)
1105 assert not _looks_like_flag("-2", parser)
1106
1107 # Does start like a flag
1108 assert _looks_like_flag("--", parser)
1109 assert _looks_like_flag("-flag", parser)
1110 assert _looks_like_flag("--flag", parser)
1111
1112
1113def test_complete_command_no_tokens(ac_app) -> None:

Callers

nothing calls this directly

Calls 2

Cmd2ArgumentParserClass · 0.90
_looks_like_flagFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…