Skip to content

Commit

Permalink
Add unit test for line tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Oct 15, 2018
1 parent 075d53f commit 5765d49
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/src/python/test_qgsserver_wms_getfeatureinfo.py
Expand Up @@ -351,6 +351,34 @@ def testGetFeatureInfoTolerance(self):
'wms_getfeatureinfo_point_tolerance_20_text_xml',
'test_project_values.qgz')

self.wms_request_compare('GetFeatureInfo',
'&layers=ls2d&styles=&' +
'VERSION=1.3.0&' +
'info_format=text%2Fxml&' +
'width=400&height=200' +
'&bbox=-50396.4,-2783.0,161715.8,114108.6' +
'&CRS=EPSG:3857' +
'&FEATURE_COUNT=10' +
'&WITH_GEOMETRY=False' +
'&QUERY_LAYERS=ls2d&I=153&J=147' +
'&FI_LINE_TOLERANCE=0',
'wms_getfeatureinfo_line_tolerance_0_text_xml',
'test_project_values.qgz')

self.wms_request_compare('GetFeatureInfo',
'&layers=ls2d&styles=&' +
'VERSION=1.3.0&' +
'info_format=text%2Fxml&' +
'width=400&height=200' +
'&bbox=-50396.4,-2783.0,161715.8,114108.6' +
'&CRS=EPSG:3857' +
'&FEATURE_COUNT=10' +
'&WITH_GEOMETRY=False' +
'&QUERY_LAYERS=ls2d&I=153&J=147' +
'&FI_LINE_TOLERANCE=20',
'wms_getfeatureinfo_line_tolerance_20_text_xml',
'test_project_values.qgz')


if __name__ == '__main__':
unittest.main()
Binary file modified tests/testdata/qgis_server/db.gpkg
Binary file not shown.
Binary file modified tests/testdata/qgis_server/test_project_values.qgz
Binary file not shown.
@@ -0,0 +1,6 @@
*****
Content-Type: text/xml; charset=utf-8

<GetFeatureInfoResponse>
<Layer name="ls2d">
</GetFeatureInfoResponse>
@@ -0,0 +1,10 @@
*****
Content-Type: text/xml; charset=utf-8

<GetFeatureInfoResponse>
<Layer name="ls2d">
<Feature id="1">
<Attribute value="1" name="id"/>
</Feature>
</Layer>
</GetFeatureInfoResponse>

0 comments on commit 5765d49

Please sign in to comment.