MCPcopy Create free account
hub / github.com/celery/celery / test_parse

Method test_parse

t/unit/apps/test_multi.py:33–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

31class test_NamespacedOptionParser:
32
33 def test_parse(self):
34 x = NamespacedOptionParser(['-c:1,3', '4'])
35 x.parse()
36 assert x.namespaces.get('1,3') == {'-c': '4'}
37 x = NamespacedOptionParser(['-c:jerry,elaine', '5',
38 '--loglevel:kramer=DEBUG',
39 '--flag',
40 '--logfile=foo', '-Q', 'bar', 'a', 'b',
41 '--', '.disable_rate_limits=1'])
42 x.parse()
43 assert x.options == {
44 '--logfile': 'foo',
45 '-Q': 'bar',
46 '--flag': None,
47 }
48 assert x.values, ['a' == 'b']
49 assert x.namespaces.get('jerry,elaine') == {'-c': '5'}
50 assert x.namespaces.get('kramer') == {'--loglevel': 'DEBUG'}
51 assert x.passthrough == '-- .disable_rate_limits=1'
52
53
54def multi_args(p, *args, **kwargs):

Callers

nothing calls this directly

Calls 3

parseMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected