|
|
@@ -7,6 +7,7 @@ from test_ows import TestOWS
|
|
|
import wfs
|
|
|
import unittest
|
|
|
import urllib
|
|
|
+import urlparse
|
|
|
import mapscript
|
|
|
from lxml import objectify
|
|
|
|
|
|
@@ -27,9 +28,19 @@ class TestWFS(TestOWS):
|
|
|
self.assertEquals(layer.type,mapscript.MS_LAYER_LINE)
|
|
|
|
|
|
# download the WMS Capabilities
|
|
|
- capabilities = objectify.parse(urllib.urlopen(self._getURLWithMap(self.service.mapfilename)))
|
|
|
- capabilities = capabilities.getroot()
|
|
|
- print self._getURLWithMap(self.service.mapfilename)
|
|
|
+ url = self._getURLWithMap(self.service.mapfilename)
|
|
|
+ url = urlparse.urlparse(url)
|
|
|
+ params = urlparse.parse_qs(url[4])
|
|
|
+ params["REQUEST"] = "GetCapabilities"
|
|
|
+ params["SERVICE"] = "WMS"
|
|
|
+ params = urllib.unquote(urllib.urlencode(params,True))
|
|
|
+ attrs = (url[0],url[1],url[2],url[3],params,url[5])
|
|
|
+ resp = objectify.parse(urllib.urlopen(urlparse.urlunparse(attrs)))
|
|
|
+ capabilities = resp.getroot()
|
|
|
+
|
|
|
+ # test the wms capabilities document
|
|
|
+ self.assertEquals(capabilities.Capability.tag,"{http://www.opengis.net/wms}Capability")
|
|
|
+ self.assertEquals(capabilities.Capability.Layer.Layer.Name.text, "line")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
unittest.main()
|