Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Sep 13, 2018
1 parent af9f316 commit d30f93f
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions tests/src/python/test_qgsserver_wms_getmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,59 @@ def test_wms_getmap_filter_ogc_with_empty(self):
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Filter_OGC3")

def test_wms_getmap_filter_ogc_v2(self):
# with namespace
filter = ('<fes:Filter xmlns:fes=\"http://www.opengis.net/fes/2.0\">'
'<fes:PropertyIsEqualTo>'
'<fes:ValueReference>name</fes:ValueReference>'
'<fes:Literal>eurasia</fes:Literal>'
'</fes:PropertyIsEqualTo>'
'</fes:Filter>')

qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.1.1",
"REQUEST": "GetMap",
"LAYERS": "Country,Hello",
"STYLES": "",
"FORMAT": "image/png",
"BBOX": "-16817707,-4710778,5696513,14587125",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"FILTER": filter
}.items())])

r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Filter_OGC_V2")

# without namespace (only with prefix)
filter = ('<fes:Filter>'
'<fes:PropertyIsEqualTo>'
'<fes:ValueReference>name</fes:ValueReference>'
'<fes:Literal>eurasia</fes:Literal>'
'</fes:PropertyIsEqualTo>'
'</fes:Filter>')

qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.1.1",
"REQUEST": "GetMap",
"LAYERS": "Country,Hello",
"STYLES": "",
"FORMAT": "image/png",
"BBOX": "-16817707,-4710778,5696513,14587125",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"FILTER": filter
}.items())])

r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Filter_OGC_V2")

def test_wms_getmap_selection(self):
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d30f93f

Please sign in to comment.