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
| 538 | |
| 539 | |
| 540 | class TestOptionalsAlternatePrefixCharsAddedHelp(ParserTestCase): |
| 541 | """When ``-`` not in prefix_chars, default operators created for help |
| 542 | should use the prefix_chars in use rather than - or -- |
| 543 | http://bugs.python.org/issue9444""" |
| 544 | |
| 545 | parser_signature = Sig(prefix_chars='+:/', add_help=True) |
| 546 | argument_signatures = [ |
| 547 | Sig('+f', action='store_true'), |
| 548 | Sig('::bar'), |
| 549 | Sig('/baz', action='store_const', const=42), |
| 550 | ] |
| 551 | failures = ['--bar', '-fbar', '-b B', 'B', '-f', '--bar B', '-baz'] |
| 552 | successes = [ |
| 553 | ('', NS(f=False, bar=None, baz=None)), |
| 554 | ('+f', NS(f=True, bar=None, baz=None)), |
| 555 | ('::ba B', NS(f=False, bar='B', baz=None)), |
| 556 | ('+f ::bar B', NS(f=True, bar='B', baz=None)), |
| 557 | ('+f /b', NS(f=True, bar=None, baz=42)), |
| 558 | ('/ba +f', NS(f=True, bar=None, baz=42)) |
| 559 | ] |
| 560 | |
| 561 | |
| 562 | class TestOptionalsAlternatePrefixCharsMultipleShortArgs(ParserTestCase): |