@@ -350,13 +350,31 @@ def testChangeAttr(self):
350350 def testGetAttrList (self ):
351351 pass
352352
353- def testGetAttrValues (self ): pass
353+ def testGetAttrValues (self ):
354+ pass
354355
355- def testGetAttrLength (self ): pass
356+ def testGetAttrLength (self ):
357+ pass
356358
357- def testGetAttribute (self ): pass
359+ def testGetAttribute (self ):
360+ dom = Document ()
361+ child = dom .appendChild (
362+ dom .createElementNS ("http://www.python.org" , "python:abc" ))
363+ self .assertEqual (child .getAttribute ('missing' ), '' )
358364
359- def testGetAttributeNS (self ): pass
365+ def testGetAttributeNS (self ):
366+ dom = Document ()
367+ child = dom .appendChild (
368+ dom .createElementNS ("http://www.python.org" , "python:abc" ))
369+ child .setAttributeNS ("http://www.w3.org" , "xmlns:python" ,
370+ "http://www.python.org" )
371+ self .assertEqual (child .getAttributeNS ("http://www.w3.org" , "python" ),
372+ 'http://www.python.org' )
373+ self .assertEqual (child .getAttributeNS ("http://www.w3.org" , "other" ),
374+ '' )
375+ child2 = child .appendChild (dom .createElement ('abc' ))
376+ self .assertEqual (child2 .getAttributeNS ("http://www.python.org" , "missing" ),
377+ '' )
360378
361379 def testGetAttributeNode (self ): pass
362380
0 commit comments