MCPcopy
hub / github.com/docopt/docopt / test_option_match

Function test_option_match

test_docopt.py:145–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143
144
145def test_option_match():
146 assert Option('-a').match([Option('-a', value=True)]) == \
147 (True, [], [Option('-a', value=True)])
148 assert Option('-a').match([Option('-x')]) == (False, [Option('-x')], [])
149 assert Option('-a').match([Argument('N')]) == (False, [Argument('N')], [])
150 assert Option('-a').match([Option('-x'), Option('-a'), Argument('N')]) == \
151 (True, [Option('-x'), Argument('N')], [Option('-a')])
152 assert Option('-a').match([Option('-a', value=True), Option('-a')]) == \
153 (True, [Option('-a')], [Option('-a', value=True)])
154
155
156def test_argument_match():

Callers

nothing calls this directly

Calls 3

OptionClass · 0.90
ArgumentClass · 0.90
matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…