@@ -200,7 +200,7 @@ def test_subparser():
200200 - "" : {}
201201 - "-z" : UnknowArgException(z)
202202 - "-a" : {a: True}
203- - "-a --sub toto -b" : {a:True, sub: [{type : toto, b: True}] }
203+ - "-a --sub toto -b" : {a:True, sub: {'toto' : { b: True}} }
204204 - "-b" : BadContextException(b, [toto])
205205
206206 Parser description :
@@ -223,7 +223,7 @@ def test_subparser():
223223 check_parsing_result (parser , '-a' , {'a' : True })
224224
225225 check_parsing_result (parser , '-a --sub toto -b' ,
226- {'a' : True , 'sub' : [{ 'type ' : 'toto' , 'b' : True }] })
226+ {'a' : True , 'sub' : { 'toto ' : { 'b' : True }} })
227227
228228 with pytest .raises (BadContextException ):
229229 check_parsing_result (parser , '-b' , None )
@@ -364,7 +364,7 @@ def test_add_component_subparser_with_two_name():
364364 subparser = ComponentSubParser ('titi' )
365365 subparser .add_argument ('a' , 'aaa' , flag = True , action = store_true , default = False )
366366 parser .add_component_subparser ('sub' , subparser )
367- check_parsing_result (parser , '--sub titi -a' , {'sub' : [{ 'type ' : 'titi' , ' aaa' : True }] })
367+ check_parsing_result (parser , '--sub titi -a' , {'sub' : { 'titi ' : { ' aaa' : True }} })
368368
369369
370370def test_parse_empty_string_default_value ():
@@ -404,25 +404,24 @@ def test_component_subparser_normal_token_list(component_subparser):
404404 test component_subparser, parse a token list which contain only subparser
405405 argument [('a', '')].
406406
407- must return return a dictionary {'type': 'test', ' a':''} as parse result
407+ must return return a dictionary {'a':''} as parse result
408408 and a empty token list
409409
410410 """
411- assert component_subparser .subparse ([('a' , '' )]) == ([], {'type' : 'test' ,
412- 'a' : None })
411+ assert component_subparser .subparse ([('a' , '' )]) == ([], {'a' : None })
413412
414413
415414def test_component_subparser_full_token_list (component_subparser ):
416415 """
417416 test component_subparser, parse a token list which contain subparser
418417 argument and arguments from other parser[('a', ''), ('b', '')].
419418
420- must return return a dictionary {'type': 'test', ' a':''} as parse result
419+ must return return a dictionary {'a':''} as parse result
421420 and a token list that contains the unparsed arguments : [('b', '')].
422421
423422 """
424423 assert component_subparser .subparse ([('a' , '' ), ('b' , '' )]) == ([('b' , '' )],
425- {'type' : 'test' , ' a' : None })
424+ {'a' : None })
426425
427426
428427def test_subparser_empty_token_list_default_value ():
0 commit comments