MCPcopy Index your code
hub / github.com/python/cpython / TestOptionalsDoubleDashPrefixMatch

Class TestOptionalsDoubleDashPrefixMatch

Lib/test/test_argparse.py:482–498  ·  view source on GitHub ↗

Tests when one double-dash option string is a prefix of another

Source from the content-addressed store, hash-verified

480
481
482class TestOptionalsDoubleDashPrefixMatch(ParserTestCase):
483 """Tests when one double-dash option string is a prefix of another"""
484
485 argument_signatures = [
486 Sig('--badger', action='store_true'),
487 Sig('--ba'),
488 ]
489 failures = ['--bar', '--b', '--ba', '--b=2', '--badge 5']
490 successes = [
491 ('', NS(badger=False, ba=None)),
492 ('--ba X', NS(badger=False, ba='X')),
493 ('--ba=X', NS(badger=False, ba='X')),
494 ('--bad', NS(badger=True, ba=None)),
495 ('--badg', NS(badger=True, ba=None)),
496 ('--badge', NS(badger=True, ba=None)),
497 ('--badger', NS(badger=True, ba=None)),
498 ]
499
500
501class TestOptionalsSingleDoubleDash(ParserTestCase):

Callers

nothing calls this directly

Calls 2

SigClass · 0.85
NSClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…