File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ <odML version =" 1" >
2
+ <date >2008-07-07</date >
3
+ <section >
4
+ <name >sec_one</name >
5
+ <type >mainsec</type >
6
+ <section >
7
+ <name >subsec_one</name >
8
+ <type >subsec</type >
9
+ </section >
10
+ <property >
11
+ <name >prop_name</name >
12
+ <value >
13
+ ['one', 'two']
14
+ <type >string</type >
15
+ </value >
16
+ <value >
17
+ 1
18
+ <type >int</type >
19
+ </value >
20
+ </property >
21
+ </section >
22
+ <author >author</author >
23
+ </odML >
Original file line number Diff line number Diff line change @@ -510,3 +510,20 @@ def test_convert_odml_file_value(self):
510
510
prop = sec .findall ("property" )[5 ]
511
511
self .assertEqual (len (prop ), 1 )
512
512
self .assertEqual (len (prop .findall ("name" )), 1 )
513
+
514
+ def test_convert_xml_file (self ):
515
+ # Test minimal reading from an xml file.
516
+ basefile = os .path .join (self .basepath , "version_conversion.xml" )
517
+
518
+ root = self .VC (basefile )._parse_xml ().getroot ()
519
+ self .assertIsNotNone (root .find ("section" ))
520
+
521
+ sec = root .find ("section" )
522
+ self .assertIsNotNone (sec .find ("name" ))
523
+ self .assertIsNotNone (sec .find ("type" ))
524
+ self .assertIsNotNone (sec .find ("section" ).find ("name" ))
525
+ self .assertIsNotNone (sec .find ("property" ))
526
+
527
+ prop = sec .find ("property" )
528
+ self .assertIsNotNone (prop .find ("name" ))
529
+ self .assertIsNotNone (prop .find ("value" ))
You can’t perform that action at this time.
0 commit comments