MCPcopy
hub / github.com/docopt/docopt / test_commands

Function test_commands

test_docopt.py:56–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54
55
56def test_commands():
57 assert docopt('Usage: prog add', 'add') == {'add': True}
58 assert docopt('Usage: prog [add]', '') == {'add': False}
59 assert docopt('Usage: prog [add]', 'add') == {'add': True}
60 assert docopt('Usage: prog (add|rm)', 'add') == {'add': True, 'rm': False}
61 assert docopt('Usage: prog (add|rm)', 'rm') == {'add': False, 'rm': True}
62 assert docopt('Usage: prog a b', 'a b') == {'a': True, 'b': True}
63 with raises(DocoptExit):
64 docopt('Usage: prog a b', 'b a')
65
66
67def test_printable_and_formal_usage():

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…