Skip to content

Commit 6fce785

Browse files
committedOct 15, 2018
Add unit test for point tolerance
1 parent 2c5d1c5 commit 6fce785

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed
 

‎tests/src/python/test_qgsserver_wms_getfeatureinfo.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,35 @@ def testGetFeatureInfoFilter(self):
322322
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.parse.quote(':"NAME" = \'two\''),
323323
'wms_getfeatureinfo_filter_no_width')
324324

325+
def testGetFeatureInfoTolerance(self):
326+
self.wms_request_compare('GetFeatureInfo',
327+
'&layers=layer3&styles=&' +
328+
'VERSION=1.3.0&' +
329+
'info_format=text%2Fxml&' +
330+
'width=400&height=200' +
331+
'&bbox=913119.2,5605988.9,913316.0,5606047.4' +
332+
'&CRS=EPSG:3857' +
333+
'&FEATURE_COUNT=10' +
334+
'&WITH_GEOMETRY=False' +
335+
'&QUERY_LAYERS=layer3&I=193&J=100' +
336+
'&FI_POINT_TOLERANCE=0',
337+
'wms_getfeatureinfo_point_tolerance_0_text_xml',
338+
'test_project_values.qgz')
339+
340+
self.wms_request_compare('GetFeatureInfo',
341+
'&layers=layer3&styles=&' +
342+
'VERSION=1.3.0&' +
343+
'info_format=text%2Fxml&' +
344+
'width=400&height=200' +
345+
'&bbox=913119.2,5605988.9,913316.0,5606047.4' +
346+
'&CRS=EPSG:3857' +
347+
'&FEATURE_COUNT=10' +
348+
'&WITH_GEOMETRY=False' +
349+
'&QUERY_LAYERS=layer3&I=193&J=100' +
350+
'&FI_POINT_TOLERANCE=20',
351+
'wms_getfeatureinfo_point_tolerance_20_text_xml',
352+
'test_project_values.qgz')
353+
325354

326355
if __name__ == '__main__':
327356
unittest.main()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*****
2+
Content-Type: text/xml; charset=utf-8
3+
4+
<GetFeatureInfoResponse>
5+
<Layer name="layer3">
6+
<Feature id="2">
7+
<Attribute value="2" name="id"/>
8+
<Attribute value="" name="location"/>
9+
</Feature>
10+
</Layer>
11+
</GetFeatureInfoResponse>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*****
2+
Content-Type: text/xml; charset=utf-8
3+
4+
<GetFeatureInfoResponse>
5+
<Layer name="layer3">
6+
<Feature id="1">
7+
<Attribute value="1" name="id"/>
8+
<Attribute value="Id no. 1 value, Id no. 2 value, Id número 3 value" name="location"/>
9+
</Feature>
10+
<Feature id="2">
11+
<Attribute value="2" name="id"/>
12+
<Attribute value="" name="location"/>
13+
</Feature>
14+
</Layer>
15+
</GetFeatureInfoResponse>

0 commit comments

Comments
 (0)
Please sign in to comment.