@@ -203,25 +203,6 @@ def serialize_check(self, elem, expected):
203203 def test_interface (self ):
204204 # Test element tree interface.
205205
206- def check_string (string ):
207- len (string )
208- for char in string :
209- self .assertEqual (len (char ), 1 ,
210- msg = "expected one-character string, got %r" % char )
211- new_string = string + ""
212- new_string = string + " "
213- string [:0 ]
214-
215- def check_mapping (mapping ):
216- len (mapping )
217- keys = mapping .keys ()
218- items = mapping .items ()
219- for key in keys :
220- item = mapping [key ]
221- mapping ["key" ] = "value"
222- self .assertEqual (mapping ["key" ], "value" ,
223- msg = "expected value string, got %r" % mapping ["key" ])
224-
225206 def check_element (element ):
226207 self .assertTrue (ET .iselement (element ), msg = "not an element" )
227208 direlem = dir (element )
@@ -231,12 +212,12 @@ def check_element(element):
231212 self .assertIn (attr , direlem ,
232213 msg = 'no %s visible by dir' % attr )
233214
234- check_string (element .tag )
235- check_mapping (element .attrib )
215+ self . assertIsInstance (element .tag , str )
216+ self . assertIsInstance (element .attrib , dict )
236217 if element .text is not None :
237- check_string (element .text )
218+ self . assertIsInstance (element .text , str )
238219 if element .tail is not None :
239- check_string (element .tail )
220+ self . assertIsInstance (element .tail , str )
240221 for elem in element :
241222 check_element (elem )
242223
0 commit comments