MCPcopy
hub / github.com/docopt/docopt / test_any_options_parameter

Function test_any_options_parameter

test_docopt.py:474–489  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

472
473
474def test_any_options_parameter():
475 with raises(DocoptExit):
476 docopt('usage: prog [options]', '-foo --bar --spam=eggs')
477# assert docopt('usage: prog [options]', '-foo --bar --spam=eggs',
478# any_options=True) == {'-f': True, '-o': 2,
479# '--bar': True, '--spam': 'eggs'}
480 with raises(DocoptExit):
481 docopt('usage: prog [options]', '--foo --bar --bar')
482# assert docopt('usage: prog [options]', '--foo --bar --bar',
483# any_options=True) == {'--foo': True, '--bar': 2}
484 with raises(DocoptExit):
485 docopt('usage: prog [options]', '--bar --bar --bar -ffff')
486# assert docopt('usage: prog [options]', '--bar --bar --bar -ffff',
487# any_options=True) == {'--bar': 3, '-f': 4}
488 with raises(DocoptExit):
489 docopt('usage: prog [options]', '--long=arg --long=another')
490# assert docopt('usage: prog [options]', '--long=arg --long=another',
491# any_options=True) == {'--long': ['arg', 'another']}
492

Callers

nothing calls this directly

Calls 1

docoptFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…