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

Class TestOptionalsSingleDashAmbiguous

Lib/test/test_argparse.py:414–434  ·  view source on GitHub ↗

Test Optionals that partially match but are not subsets

Source from the content-addressed store, hash-verified

412
413
414class TestOptionalsSingleDashAmbiguous(ParserTestCase):
415 """Test Optionals that partially match but are not subsets"""
416
417 argument_signatures = [Sig('-foobar'), Sig('-foorab')]
418 failures = ['-f', '-f a', '-fa', '-foa', '-foo', '-fo', '-foo b',
419 '-f=a', '-foo=b']
420 successes = [
421 ('', NS(foobar=None, foorab=None)),
422 ('-foob a', NS(foobar='a', foorab=None)),
423 ('-foob=a', NS(foobar='a', foorab=None)),
424 ('-foor a', NS(foobar=None, foorab='a')),
425 ('-foor=a', NS(foobar=None, foorab='a')),
426 ('-fooba a', NS(foobar='a', foorab=None)),
427 ('-fooba=a', NS(foobar='a', foorab=None)),
428 ('-foora a', NS(foobar=None, foorab='a')),
429 ('-foora=a', NS(foobar=None, foorab='a')),
430 ('-foobar a', NS(foobar='a', foorab=None)),
431 ('-foobar=a', NS(foobar='a', foorab=None)),
432 ('-foorab a', NS(foobar=None, foorab='a')),
433 ('-foorab=a', NS(foobar=None, foorab='a')),
434 ]
435
436
437class TestOptionalsNumeric(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…