@@ -467,7 +467,20 @@ def test_convert_odml_file_value(self):
467
467
<checksum>Checksum</checksum>
468
468
</value>
469
469
</property>
470
-
470
+
471
+ <property>
472
+ <name>Unsupported binary value type replace</name>
473
+ <value>0
474
+ <type>binary</type>
475
+ </value>
476
+ </property>
477
+ <property>
478
+ <name>Unsupported binary value dtype replace</name>
479
+ <value>1
480
+ <dtype>binary</dtype>
481
+ </value>
482
+ </property>
483
+
471
484
</section>
472
485
</odML>
473
486
"""
@@ -477,7 +490,7 @@ def test_convert_odml_file_value(self):
477
490
conv_doc = vc ._convert (vc ._parse_xml ())
478
491
root = conv_doc .getroot ()
479
492
sec = root .find ("section" )
480
- self .assertEqual (len (sec ), 7 )
493
+ self .assertEqual (len (sec ), 9 )
481
494
482
495
# Test single value export
483
496
prop = sec .findall ("property" )[0 ]
@@ -520,6 +533,14 @@ def test_convert_odml_file_value(self):
520
533
self .assertEqual (len (prop ), 1 )
521
534
self .assertEqual (len (prop .findall ("name" )), 1 )
522
535
536
+ # Test dtype 'binary' replacement
537
+ prop = sec .findall ("property" )[6 ]
538
+ self .assertEqual (prop .find ("name" ).text , "Unsupported binary value type replace" )
539
+ self .assertEqual (prop .find ("type" ).text , "text" )
540
+ prop = sec .findall ("property" )[7 ]
541
+ self .assertEqual (prop .find ("name" ).text , "Unsupported binary value dtype replace" )
542
+ self .assertEqual (prop .find ("type" ).text , "text" )
543
+
523
544
def test_parse_dict_document (self ):
524
545
# Test appending tags; not appending empty sections
525
546
doc_dict = {'Document' : {'author' : 'HPL' , 'sections' : []}}
0 commit comments