Commit 09cfe422 authored by Christian Ledermann's avatar Christian Ledermann

register_namespace was introduced in python 2.7 xml.etree

parent caff9b87
......@@ -123,8 +123,13 @@ class BuildKmlTestCase(unittest.TestCase):
self.assertEqual( str(k.to_string())[:43],
'<kml xmlns="http://www.opengis.net/kml/2.2"/>'[:43])
else:
self.assertEqual(str(k.to_string())[:51],
'<ns0:kml xmlns:ns0="http://www.opengis.net/kml/2.2" />'[:51])
if hasattr(etree, 'register_namespace'):
self.assertEqual(str(k.to_string())[:51],
'<kml:kml xmlns:kml="http://www.opengis.net/kml/2.2" />'[:51])
else:
self.assertEqual(str(k.to_string())[:51],
'<ns0:kml xmlns:ns0="http://www.opengis.net/kml/2.2" />'[:51])
k2 = kml.KML()
k2.from_string(k.to_string())
self.assertEqual(k.to_string(), k2.to_string())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment