File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -520,6 +520,22 @@ def test_convert_odml_file_value(self):
520520 self .assertEqual (len (prop ), 1 )
521521 self .assertEqual (len (prop .findall ("name" )), 1 )
522522
523+ def test_parse_dict_document (self ):
524+ # Test appending tags; not appending empty sections
525+ doc_dict = {'Document' : {'author' : 'HPL' , 'sections' : []}}
526+
527+ root = self .VC ("" )._parse_dict_document (doc_dict ).getroot ()
528+ self .assertEqual (len (root .getchildren ()), 1 )
529+ self .assertIsNotNone (root .find ("author" ))
530+
531+ # Test appending multiple sections
532+ doc_dict = {'Document' : {'author' : 'HPL' , 'sections' : [{'name' : 'sec_one' },
533+ {'name' : 'sec_two' }]}}
534+
535+ root = self .VC ("" )._parse_dict_document (doc_dict ).getroot ()
536+ self .assertEqual (len (root .getchildren ()), 3 )
537+ self .assertEqual (len (root .findall ("section" )), 2 )
538+
523539 def test_parse_dict_sections (self ):
524540 # Test appending tags; not appending empty subsections or properties
525541 root = ET .Element ("root" )
You can’t perform that action at this time.
0 commit comments