MCPcopy
hub / github.com/docopt/docopt / test_command_match

Function test_command_match

test_docopt.py:168–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166
167
168def test_command_match():
169 assert Command('c').match([Argument(None, 'c')]) == \
170 (True, [], [Command('c', True)])
171 assert Command('c').match([Option('-x')]) == (False, [Option('-x')], [])
172 assert Command('c').match([Option('-x'),
173 Option('-a'),
174 Argument(None, 'c')]) == \
175 (True, [Option('-x'), Option('-a')], [Command('c', True)])
176 assert Either(Command('add', False), Command('rm', False)).match(
177 [Argument(None, 'rm')]) == (True, [], [Command('rm', True)])
178
179
180def test_optional_match():

Callers

nothing calls this directly

Calls 5

CommandClass · 0.90
ArgumentClass · 0.90
OptionClass · 0.90
EitherClass · 0.90
matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…