Skip to content

Commit a6b44b1

Browse files
committedSep 7, 2018
Add unit test for OGC filters with multiple layers
1 parent 34c1d7a commit a6b44b1

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed
 

‎tests/src/python/test_qgsserver_wms_getmap.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,8 +821,9 @@ def test_wms_getmap_filter_ogc_with_empty(self):
821821
r, h = self._result(self._execute_request(qs))
822822
self._img_diff_error(r, h, "WMS_GetMap_Filter_OGC")
823823

824-
def test_wms_getmap_filter_ogc_empty(self):
825-
filter = "(<ogc:Filter xmlns=\"http://www.opengis.net/ogc\"></ogc:Filter>)"
824+
# empty filter
825+
filter = ("(<ogc:Filter xmlns=\"http://www.opengis.net/ogc\">"
826+
"</ogc:Filter>)")
826827
qs = "?" + "&".join(["%s=%s" % i for i in list({
827828
"MAP": urllib.parse.quote(self.projectPath),
828829
"SERVICE": "WMS",
@@ -841,6 +842,30 @@ def test_wms_getmap_filter_ogc_empty(self):
841842
r, h = self._result(self._execute_request(qs))
842843
self._img_diff_error(r, h, "WMS_GetMap_Filter_OGC2")
843844

845+
# filter on the second layer
846+
filter_hello = ("(<Filter></Filter>)")
847+
filter_country = ("(<Filter><PropertyIsEqualTo><PropertyName>name"
848+
"</PropertyName><Literal>eurasia</Literal>"
849+
"</PropertyIsEqualTo></Filter>)")
850+
filter = "{}{}".format(filter_hello, filter_country)
851+
qs = "?" + "&".join(["%s=%s" % i for i in list({
852+
"MAP": urllib.parse.quote(self.projectPath),
853+
"SERVICE": "WMS",
854+
"VERSION": "1.1.1",
855+
"REQUEST": "GetMap",
856+
"LAYERS": "Hello,Country",
857+
"STYLES": "",
858+
"FORMAT": "image/png",
859+
"BBOX": "-16817707,-4710778,5696513,14587125",
860+
"HEIGHT": "500",
861+
"WIDTH": "500",
862+
"CRS": "EPSG:3857",
863+
"FILTER": filter
864+
}.items())])
865+
866+
r, h = self._result(self._execute_request(qs))
867+
self._img_diff_error(r, h, "WMS_GetMap_Filter_OGC3")
868+
844869
def test_wms_getmap_selection(self):
845870
qs = "?" + "&".join(["%s=%s" % i for i in list({
846871
"MAP": urllib.parse.quote(self.projectPath),
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.