File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ Document :
2
+ version : v1.13
3
+ author : author
4
+ date : ' 2008-07-07'
5
+ sections :
6
+ - name : sec_one
7
+ type : mainsec
8
+ sections :
9
+ - name : subsec_one
10
+ type : subsec
11
+ properties :
12
+ - name : prop_name
13
+ values :
14
+ - dtype : !!python/object/apply:odml.dtypes.DType
15
+ - string
16
+ value : ' ['' one'' , '' two'' ]'
17
+ - dtype : !!python/object/apply:odml.dtypes.DType
18
+ - int
19
+ value : ' 1'
20
+ odml-version : ' 1'
Original file line number Diff line number Diff line change @@ -527,3 +527,20 @@ def test_convert_xml_file(self):
527
527
prop = sec .find ("property" )
528
528
self .assertIsNotNone (prop .find ("name" ))
529
529
self .assertIsNotNone (prop .find ("value" ))
530
+
531
+ def test_convert_yaml_file (self ):
532
+ # Test minimal reading from a yaml file.
533
+ basefile = os .path .join (self .basepath , "version_conversion.yaml" )
534
+
535
+ root = self .VC (basefile )._parse_yaml ().getroot ()
536
+ self .assertIsNotNone (root .find ("section" ))
537
+
538
+ sec = root .find ("section" )
539
+ self .assertIsNotNone (sec .find ("name" ))
540
+ self .assertIsNotNone (sec .find ("type" ))
541
+ self .assertIsNotNone (sec .find ("section" ))
542
+ self .assertIsNotNone (sec .find ("property" ))
543
+
544
+ prop = sec .find ("property" )
545
+ self .assertIsNotNone (prop .find ("name" ))
546
+ self .assertIsNotNone (prop .find ("value" ))
You can’t perform that action at this time.
0 commit comments