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

Class TestOptionalsDoubleDashPartialMatch

Lib/test/test_argparse.py:464–479  ·  view source on GitHub ↗

Tests partial matching with a double-dash option string

Source from the content-addressed store, hash-verified

462
463
464class TestOptionalsDoubleDashPartialMatch(ParserTestCase):
465 """Tests partial matching with a double-dash option string"""
466
467 argument_signatures = [
468 Sig('--badger', action='store_true'),
469 Sig('--bat'),
470 ]
471 failures = ['--bar', '--b', '--ba', '--b=2', '--ba=4', '--badge 5']
472 successes = [
473 ('', NS(badger=False, bat=None)),
474 ('--bat X', NS(badger=False, bat='X')),
475 ('--bad', NS(badger=True, bat=None)),
476 ('--badg', NS(badger=True, bat=None)),
477 ('--badge', NS(badger=True, bat=None)),
478 ('--badger', NS(badger=True, bat=None)),
479 ]
480
481
482class TestOptionalsDoubleDashPrefixMatch(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…