File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -520,6 +520,22 @@ def test_convert_odml_file_value(self):
520
520
self .assertEqual (len (prop ), 1 )
521
521
self .assertEqual (len (prop .findall ("name" )), 1 )
522
522
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
+
523
539
def test_parse_dict_sections (self ):
524
540
# Test appending tags; not appending empty subsections or properties
525
541
root = ET .Element ("root" )
You can’t perform that action at this time.
0 commit comments