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
| 518 | |
| 519 | |
| 520 | class 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 | |
| 542 | class TestOptionalsAlternatePrefixCharsMultipleShortArgs(ParserTestCase): |