@@ -120,7 +120,9 @@ def test_opc_type_dict_add_field_3(self):
120120 'Name' : 'id' }]
121121 struct_dict = getattr (self .opc_type_builder , '_structs_dict' )
122122 result = [item .attrib for item in list (struct_dict [structure_name ])]
123- self .assertItemsEqual (result , case )
123+ self .assertTrue (len (case ), len (result ))
124+ for item in case :
125+ self .assertTrue (item in result )
124126
125127 def test_opc_type_dict_get_dict_value (self ):
126128 structure_name = 'CustomizedStruct'
@@ -135,7 +137,7 @@ def test_opc_type_dict_get_dict_value(self):
135137 field = Et .SubElement (appended_struct , 'opc:Field' )
136138 field .attrib ['Name' ] = 'id'
137139 field .attrib ['TypeName' ] = 'opc:Boolean'
138- case = Et .tostring (self .test_etree .getroot (), encoding = 'utf-8' ).replace (' ' , '' )
140+ case = Et .tostring (self .test_etree .getroot (), encoding = 'utf-8' ).decode ( "utf-8" ). replace (' ' , '' )
139141 result = self .opc_type_builder .get_dict_value ().replace (' ' , '' ).replace ('\n ' , '' )
140142 self .assertEqual (result , case )
141143
@@ -251,7 +253,7 @@ def test_data_type_dict_set_dict_byte_string(self):
251253 field = Et .SubElement (appended_struct , 'opc:Field' )
252254 field .attrib ['Name' ] = 'id'
253255 field .attrib ['TypeName' ] = 'opc:Int32'
254- case = Et .tostring (self .test_etree .getroot (), encoding = 'utf-8' ).replace (' ' , '' )
256+ case = Et .tostring (self .test_etree .getroot (), encoding = 'utf-8' ).decode ( "utf-8" ). replace (' ' , '' )
255257 result = self .srv .get_node (self .dict_builder .dict_id ).get_value ().replace (' ' , '' ).replace ('\n ' , '' )
256258 self .assertEqual (result , case )
257259
0 commit comments