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

register_namespace was introduced in python 2.7 xml.etree

parent caff9b87
......@@ -122,9 +122,14 @@ class BuildKmlTestCase(unittest.TestCase):
if config.LXML:
self.assertEqual( str(k.to_string())[:43],
'<kml xmlns="http://www.opengis.net/kml/2.2"/>'[:43])
else:
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