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

Class TestOptionalsSingleDashSubsetAmbiguous

Lib/test/test_argparse.py:398–411  ·  view source on GitHub ↗

Test Optionals where option strings are subsets of each other

Source from the content-addressed store, hash-verified

396
397
398class TestOptionalsSingleDashSubsetAmbiguous(ParserTestCase):
399 """Test Optionals where option strings are subsets of each other"""
400
401 argument_signatures = [Sig('-f'), Sig('-foobar'), Sig('-foorab')]
402 failures = ['-f', '-foo', '-fo', '-foo b', '-foob', '-fooba', '-foora']
403 successes = [
404 ('', NS(f=None, foobar=None, foorab=None)),
405 ('-f a', NS(f='a', foobar=None, foorab=None)),
406 ('-fa', NS(f='a', foobar=None, foorab=None)),
407 ('-foa', NS(f='oa', foobar=None, foorab=None)),
408 ('-fooa', NS(f='ooa', foobar=None, foorab=None)),
409 ('-foobar a', NS(f=None, foobar='a', foorab=None)),
410 ('-foorab a', NS(f=None, foobar=None, foorab='a')),
411 ]
412
413
414class TestOptionalsSingleDashAmbiguous(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…