MCPcopy Index your code
hub / github.com/RustPython/RustPython / TestOptionalsAlternatePrefixCharsAddedHelp

Class TestOptionalsAlternatePrefixCharsAddedHelp

Lib/test/test_argparse.py:520–539  ·  view source on GitHub ↗

When ``-`` not in prefix_chars, default operators created for help should use the prefix_chars in use rather than - or -- http://bugs.python.org/issue9444

Source from the content-addressed store, hash-verified

518
519
520class TestOptionalsAlternatePrefixCharsAddedHelp(ParserTestCase):
521 """When ``-`` not in prefix_chars, default operators created for help
522 should use the prefix_chars in use rather than - or --
523 http://bugs.python.org/issue9444"""
524
525 parser_signature = Sig(prefix_chars='+:/', add_help=True)
526 argument_signatures = [
527 Sig('+f', action='store_true'),
528 Sig('::bar'),
529 Sig('/baz', action='store_const', const=42),
530 ]
531 failures = ['--bar', '-fbar', '-b B', 'B', '-f', '--bar B', '-baz']
532 successes = [
533 ('', NS(f=False, bar=None, baz=None)),
534 ('+f', NS(f=True, bar=None, baz=None)),
535 ('::ba B', NS(f=False, bar='B', baz=None)),
536 ('+f ::bar B', NS(f=True, bar='B', baz=None)),
537 ('+f /b', NS(f=True, bar=None, baz=42)),
538 ('/ba +f', NS(f=True, bar=None, baz=42))
539 ]
540
541
542class TestOptionalsAlternatePrefixCharsMultipleShortArgs(ParserTestCase):

Callers

nothing calls this directly

Calls 2

SigClass · 0.85
NSClass · 0.70

Tested by

no test coverage detected