def test_grouping_structure(complete_parser):
 result = convert(complete_parser)
 groupings = result['widgets']
 assert isinstance(groupings, dict)
 for (name, group) in groupings.iteritems():
  assert ('command' in group)
  assert ('contents' in group)
  assert isinstance(group['contents'], list)

def test_grouping_structure ( complete_parser ) : result = convert ( complete_parser ) groupings = result [ 'widgets' ] assert isinstance ( groupings , dict ) for ( name , group ) in groupings . iteritems ( ) : assert ( 'command' in group ) assert ( 'contents' in group ) assert isinstance ( group [ 'contents' ] , list )
the output of the widgets branch is now wrapped in another layer to facilitate interop with the subparser structure old: widgets: [] new: widgets: {a: {} .