Skip to content

Commit a5d61a5

Browse files
committedMay 5, 2017
[server] More WMS tests for FILTER parameter with bool operators and UTF8
Needs forward porting
1 parent 0780756 commit a5d61a5

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed
 

‎tests/src/python/test_qgsserver.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,26 @@ def test_project_wms(self):
224224
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.quote(':"NAME" = \'two\''),
225225
'wms_getfeatureinfo_filter')
226226

227+
# Test a filter with OR condition results
228+
self.wms_request_compare('GetFeatureInfo',
229+
'&layers=testlayer%20%C3%A8%C3%A9&' +
230+
'INFO_FORMAT=text%2Fxml&' +
231+
'width=600&height=400&srs=EPSG%3A3857&' +
232+
'query_layers=testlayer%20%C3%A8%C3%A9&' +
233+
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.quote(':"NAME" = \'two\' OR "NAME" = \'three\''),
234+
'wms_getfeatureinfo_filter_or')
235+
236+
# Test a filter with OR condition and UTF results
237+
# Note that the layer name that contains utf-8 chars cannot be
238+
# to upper case.
239+
self.wms_request_compare('GetFeatureInfo',
240+
'&layers=testlayer%20%C3%A8%C3%A9&' +
241+
'INFO_FORMAT=text%2Fxml&' +
242+
'width=600&height=400&srs=EPSG%3A3857&' +
243+
'query_layers=testlayer%20%C3%A8%C3%A9&' +
244+
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.quote(':"NAME" = \'two\' OR "utf8nameè" = \'three èé↓\''),
245+
'wms_getfeatureinfo_filter_or_utf8')
246+
227247
def wms_inspire_request_compare(self, request):
228248
"""WMS INSPIRE tests"""
229249
project = self.testdata_path + "test_project_inspire.qgs"
@@ -917,5 +937,6 @@ def _img_diff_error(self, response, headers, image, max_diff=10, max_size_diff=Q
917937

918938
self.assertTrue(test, message)
919939

940+
920941
if __name__ == '__main__':
921942
unittest.main()
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 CRS="EPSG:3857" maxx="913214.67407005" minx="913204.91280263" maxy="5606017.87425818" miny="5606011.45647302"/>
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 CRS="EPSG:3857" maxx="913214.6741" minx="913214.6741" maxy="5606017.8743" miny="5606017.8743"/>
12+
<Attribute value="Point (913214.6741 5606017.8743)" type="derived" 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 CRS="EPSG:3857" maxx="913204.9128" minx="913204.9128" maxy="5606011.4565" miny="5606011.4565"/>
19+
<Attribute value="Point (913204.9128 5606011.4565)" type="derived" 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 CRS="EPSG:3857" maxx="913214.67407005" minx="913204.91280263" maxy="5606017.87425818" miny="5606011.45647302"/>
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 CRS="EPSG:3857" maxx="913214.6741" minx="913214.6741" maxy="5606017.8743" miny="5606017.8743"/>
12+
<Attribute value="Point (913214.6741 5606017.8743)" type="derived" 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 CRS="EPSG:3857" maxx="913204.9128" minx="913204.9128" maxy="5606011.4565" miny="5606011.4565"/>
19+
<Attribute value="Point (913204.9128 5606011.4565)" type="derived" name="geometry"/>
20+
</Feature>
21+
</Layer>
22+
</GetFeatureInfoResponse>
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 CRS="EPSG:3857" maxx="0" minx="0" maxy="0" miny="0"/>
6+
<Layer name="testlayer èé"/>
7+
</GetFeatureInfoResponse>

0 commit comments

Comments
 (0)
Please sign in to comment.