Skip to content

Commit 3c4567d

Browse files
committedMay 6, 2017
[server] More WMS tests for FILTER parameter with bool operators and UTF8
Forward port from 2.18 commit 8fd4fc6
1 parent a46e9a5 commit 3c4567d

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed
 

‎tests/src/python/test_qgsserver_wms.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,35 @@ def test_project_wms(self):
9696
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.parse.quote(':"NAME" = \'two\''),
9797
'wms_getfeatureinfo_filter')
9898

99+
# Test a filter with NO condition results
100+
self.wms_request_compare('GetFeatureInfo',
101+
'&layers=testlayer%20%C3%A8%C3%A9&' +
102+
'INFO_FORMAT=text%2Fxml&' +
103+
'width=600&height=400&srs=EPSG%3A3857&' +
104+
'query_layers=testlayer%20%C3%A8%C3%A9&' +
105+
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.parse.quote(':"NAME" = \'two\' AND "utf8nameè" = \'no-results\''),
106+
'wms_getfeatureinfo_filter_no_results')
107+
108+
# Test a filter with OR condition results
109+
self.wms_request_compare('GetFeatureInfo',
110+
'&layers=testlayer%20%C3%A8%C3%A9&' +
111+
'INFO_FORMAT=text%2Fxml&' +
112+
'width=600&height=400&srs=EPSG%3A3857&' +
113+
'query_layers=testlayer%20%C3%A8%C3%A9&' +
114+
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.parse.quote(':"NAME" = \'two\' OR "NAME" = \'three\''),
115+
'wms_getfeatureinfo_filter_or')
116+
117+
# Test a filter with OR condition and UTF results
118+
# Note that the layer name that contains utf-8 chars cannot be
119+
# to upper case.
120+
self.wms_request_compare('GetFeatureInfo',
121+
'&layers=testlayer%20%C3%A8%C3%A9&' +
122+
'INFO_FORMAT=text%2Fxml&' +
123+
'width=600&height=400&srs=EPSG%3A3857&' +
124+
'query_layers=testlayer%20%C3%A8%C3%A9&' +
125+
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.parse.quote(':"NAME" = \'two\' OR "utf8nameè" = \'three èé↓\''),
126+
'wms_getfeatureinfo_filter_or_utf8')
127+
99128
def wms_inspire_request_compare(self, request):
100129
"""WMS INSPIRE tests"""
101130
project = self.testdata_path + "test_project_inspire.qgs"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Content-Length: 151
2+
Content-Type: text/xml; charset=utf-8
3+
4+
<GetFeatureInfoResponse>
5+
<BoundingBox maxy="0" maxx="0" miny="0" CRS="EPSG:3857" minx="0"/>
6+
<Layer name="testlayer èé"/>
7+
</GetFeatureInfoResponse>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Content-Length: 943
2+
Content-Type: text/xml; charset=utf-8
3+
4+
<GetFeatureInfoResponse>
5+
<BoundingBox maxy="5606017.87425818" maxx="913214.67407005" miny="5606011.45647302" CRS="EPSG:3857" minx="913204.91280263"/>
6+
<Layer name="testlayer èé">
7+
<Feature id="1">
8+
<Attribute value="2" name="id"/>
9+
<Attribute value="two" name="name"/>
10+
<Attribute value="two àò" name="utf8nameè"/>
11+
<BoundingBox maxy="5606017.8743" maxx="913214.6741" miny="5606017.8743" CRS="EPSG:3857" minx="913214.6741"/>
12+
<Attribute type="derived" value="Point (913214.6741 5606017.8743)" name="geometry"/>
13+
</Feature>
14+
<Feature id="2">
15+
<Attribute value="3" name="id"/>
16+
<Attribute value="three" name="name"/>
17+
<Attribute value="three èé↓" name="utf8nameè"/>
18+
<BoundingBox maxy="5606011.4565" maxx="913204.9128" miny="5606011.4565" CRS="EPSG:3857" minx="913204.9128"/>
19+
<Attribute type="derived" value="Point (913204.9128 5606011.4565)" name="geometry"/>
20+
</Feature>
21+
</Layer>
22+
</GetFeatureInfoResponse>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Content-Length: 943
2+
Content-Type: text/xml; charset=utf-8
3+
4+
<GetFeatureInfoResponse>
5+
<BoundingBox maxy="5606017.87425818" maxx="913214.67407005" miny="5606011.45647302" CRS="EPSG:3857" minx="913204.91280263"/>
6+
<Layer name="testlayer èé">
7+
<Feature id="1">
8+
<Attribute value="2" name="id"/>
9+
<Attribute value="two" name="name"/>
10+
<Attribute value="two àò" name="utf8nameè"/>
11+
<BoundingBox maxy="5606017.8743" maxx="913214.6741" miny="5606017.8743" CRS="EPSG:3857" minx="913214.6741"/>
12+
<Attribute type="derived" value="Point (913214.6741 5606017.8743)" name="geometry"/>
13+
</Feature>
14+
<Feature id="2">
15+
<Attribute value="3" name="id"/>
16+
<Attribute value="three" name="name"/>
17+
<Attribute value="three èé↓" name="utf8nameè"/>
18+
<BoundingBox maxy="5606011.4565" maxx="913204.9128" miny="5606011.4565" CRS="EPSG:3857" minx="913204.9128"/>
19+
<Attribute type="derived" value="Point (913204.9128 5606011.4565)" name="geometry"/>
20+
</Feature>
21+
</Layer>
22+
</GetFeatureInfoResponse>

0 commit comments

Comments
 (0)
Please sign in to comment.