Skip to content

Commit

Permalink
Add unit test for point tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Oct 15, 2018
1 parent 2c5d1c5 commit 6fce785
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/src/python/test_qgsserver_wms_getfeatureinfo.py
Expand Up @@ -322,6 +322,35 @@ def testGetFeatureInfoFilter(self):
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.parse.quote(':"NAME" = \'two\''), 'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.parse.quote(':"NAME" = \'two\''),
'wms_getfeatureinfo_filter_no_width') 'wms_getfeatureinfo_filter_no_width')


def testGetFeatureInfoTolerance(self):
self.wms_request_compare('GetFeatureInfo',
'&layers=layer3&styles=&' +
'VERSION=1.3.0&' +
'info_format=text%2Fxml&' +
'width=400&height=200' +
'&bbox=913119.2,5605988.9,913316.0,5606047.4' +
'&CRS=EPSG:3857' +
'&FEATURE_COUNT=10' +
'&WITH_GEOMETRY=False' +
'&QUERY_LAYERS=layer3&I=193&J=100' +
'&FI_POINT_TOLERANCE=0',
'wms_getfeatureinfo_point_tolerance_0_text_xml',
'test_project_values.qgz')

self.wms_request_compare('GetFeatureInfo',
'&layers=layer3&styles=&' +
'VERSION=1.3.0&' +
'info_format=text%2Fxml&' +
'width=400&height=200' +
'&bbox=913119.2,5605988.9,913316.0,5606047.4' +
'&CRS=EPSG:3857' +
'&FEATURE_COUNT=10' +
'&WITH_GEOMETRY=False' +
'&QUERY_LAYERS=layer3&I=193&J=100' +
'&FI_POINT_TOLERANCE=20',
'wms_getfeatureinfo_point_tolerance_20_text_xml',
'test_project_values.qgz')



if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
@@ -0,0 +1,11 @@
*****
Content-Type: text/xml; charset=utf-8

<GetFeatureInfoResponse>
<Layer name="layer3">
<Feature id="2">
<Attribute value="2" name="id"/>
<Attribute value="" name="location"/>
</Feature>
</Layer>
</GetFeatureInfoResponse>
@@ -0,0 +1,15 @@
*****
Content-Type: text/xml; charset=utf-8

<GetFeatureInfoResponse>
<Layer name="layer3">
<Feature id="1">
<Attribute value="1" name="id"/>
<Attribute value="Id no. 1 value, Id no. 2 value, Id número 3 value" name="location"/>
</Feature>
<Feature id="2">
<Attribute value="2" name="id"/>
<Attribute value="" name="location"/>
</Feature>
</Layer>
</GetFeatureInfoResponse>

0 comments on commit 6fce785

Please sign in to comment.