Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add unit test for polygon tolerance
  • Loading branch information
pblottiere committed Oct 15, 2018
1 parent edeefc9 commit c3a41bc
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 @@ -379,6 +379,34 @@ def testGetFeatureInfoTolerance(self):
'wms_getfeatureinfo_line_tolerance_20_text_xml',
'test_project_values.qgz')

self.wms_request_compare('GetFeatureInfo',
'&layers=p2d&styles=&' +
'VERSION=1.3.0&' +
'info_format=text%2Fxml&' +
'width=400&height=200' +
'&bbox=-135832.0,-66482.4,240321.9,167300.4' +
'&CRS=EPSG:3857' +
'&FEATURE_COUNT=10' +
'&WITH_GEOMETRY=False' +
'&QUERY_LAYERS=p2d&I=206&J=144' +
'&FI_POLYGON_TOLERANCE=0',
'wms_getfeatureinfo_polygon_tolerance_0_text_xml',
'test_project_values.qgz')

self.wms_request_compare('GetFeatureInfo',
'&layers=p2d&styles=&' +
'VERSION=1.3.0&' +
'info_format=text%2Fxml&' +
'width=400&height=200' +
'&bbox=-135832.0,-66482.4,240321.9,167300.4' +
'&CRS=EPSG:3857' +
'&FEATURE_COUNT=10' +
'&WITH_GEOMETRY=False' +
'&QUERY_LAYERS=p2d&I=206&J=144' +
'&FI_POLYGON_TOLERANCE=20',
'wms_getfeatureinfo_polygon_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="p2d">
</GetFeatureInfoResponse>
@@ -0,0 +1,10 @@
*****
Content-Type: text/xml; charset=utf-8

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

0 comments on commit c3a41bc

Please sign in to comment.