MCPcopy
hub / github.com/docopt/docopt / test_long_options_error_handling

Function test_long_options_error_handling

test_docopt.py:340–357  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

338
339
340def test_long_options_error_handling():
341# with raises(DocoptLanguageError):
342# docopt('Usage: prog --non-existent', '--non-existent')
343# with raises(DocoptLanguageError):
344# docopt('Usage: prog --non-existent')
345 with raises(DocoptExit):
346 docopt('Usage: prog', '--non-existent')
347 with raises(DocoptExit):
348 docopt('''Usage: prog [--version --verbose]\n\n
349 --version\n--verbose''', '--ver')
350 with raises(DocoptLanguageError):
351 docopt('Usage: prog --long\n\n--long ARG')
352 with raises(DocoptExit):
353 docopt('Usage: prog --long ARG\n\n--long ARG', '--long')
354 with raises(DocoptLanguageError):
355 docopt('Usage: prog --long=ARG\n\n--long')
356 with raises(DocoptExit):
357 docopt('Usage: prog --long\n\n--long', '--long=ARG')
358
359
360def test_short_options_error_handling():

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…