@@ -467,7 +467,20 @@ def test_convert_odml_file_value(self):
467467 <checksum>Checksum</checksum>
468468 </value>
469469 </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+
471484 </section>
472485 </odML>
473486 """
@@ -477,7 +490,7 @@ def test_convert_odml_file_value(self):
477490 conv_doc = vc ._convert (vc ._parse_xml ())
478491 root = conv_doc .getroot ()
479492 sec = root .find ("section" )
480- self .assertEqual (len (sec ), 7 )
493+ self .assertEqual (len (sec ), 9 )
481494
482495 # Test single value export
483496 prop = sec .findall ("property" )[0 ]
@@ -520,6 +533,14 @@ def test_convert_odml_file_value(self):
520533 self .assertEqual (len (prop ), 1 )
521534 self .assertEqual (len (prop .findall ("name" )), 1 )
522535
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+
523544 def test_parse_dict_document (self ):
524545 # Test appending tags; not appending empty sections
525546 doc_dict = {'Document' : {'author' : 'HPL' , 'sections' : []}}
0 commit comments