Пример #1
0
 def georss_test(self):
     #georss tag as root
     root = createGEORSS()                
     self.assertEqual(tostring(root), '<metadata xmlns="http://www.georss.org/georss" />')
     
     #georss tag as SubElement of another root element
     root = Element('myCustomTag')
     georss = createGEORSS(root)
     root.append(georss)        
     self.assertEqual(tostring(root), '<myCustomTag xmlns:georss="http://www.georss.org/georss"><georss:metadata /></myCustomTag>')
Пример #2
0
    def where_test(self):
        root = createGEORSS() 
        where = createWhere(root, body = create_test_polygon(root))
        root.append(where)             
        self.assertEqual(tostring(root), '<metadata xmlns="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">\
<where><gml:Polygon><gml:exterior><gml:LinearRing>\
<gml:posList>45.256 -110.45 46.46 -109.48 43.84 -109.86 45.256 -110.45</gml:posList>\
</gml:LinearRing></gml:exterior></gml:Polygon></where></metadata>')
        
        root = Element('myCustomTag')
        georss = createWhere(root, body = create_test_polygon(root))
        root.append(georss)        
        self.assertEqual(tostring(root), '<myCustomTag xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">\
<georss:where><gml:Polygon><gml:exterior><gml:LinearRing>\
<gml:posList>45.256 -110.45 46.46 -109.48 43.84 -109.86 45.256 -110.45</gml:posList>\
</gml:LinearRing></gml:exterior></gml:Polygon></georss:where></myCustomTag>')