@@ -46,8 +46,8 @@ class TestQgsServerWMS(QgsServerTestBase):
46
46
# Set to True to re-generate reference files for this class
47
47
regenerate_reference = False
48
48
49
- def wms_request_compare (self , request , extra = None , reference_file = None ):
50
- project = self .testdata_path + "test_project.qgs"
49
+ def wms_request_compare (self , request , extra = None , reference_file = None , project = 'test_project.qgs' ):
50
+ project = self .testdata_path + project
51
51
assert os .path .exists (project ), "Project file not found: " + project
52
52
53
53
query_string = 'https://www.qgis.org/?MAP=%s&SERVICE=WMS&VERSION=1.3&REQUEST=%s' % (urllib .parse .quote (project ), request )
@@ -217,6 +217,21 @@ def test_getfeatureinfo(self):
217
217
'query_layers=testlayer+%C3%A8%C3%A9&X=190&Y=320' ,
218
218
'wms_getfeatureinfo-text-xml' )
219
219
220
+ # layer1 is a clone of layer0 but with a scale visibility. Thus,
221
+ # GetFeatureInfo response contains only a feature for layer0 and layer1
222
+ # is ignored for the required bbox. Without the scale visibility option,
223
+ # the feature for layer1 would have been in the response too.
224
+ mypath = self .testdata_path + "test_project_scalevisibility.qgs"
225
+ self .wms_request_compare ('GetFeatureInfo' ,
226
+ '&layers=layer0,layer1&styles=&' +
227
+ 'VERSION=1.1.0&' +
228
+ 'info_format=text%2Fxml&' +
229
+ 'width=500&height=500&srs=EPSG%3A4326' +
230
+ '&bbox=8.1976,44.8998,8.2100,44.9027&' +
231
+ 'query_layers=layer0,layer1&X=235&Y=243' ,
232
+ 'wms_getfeatureinfo_notvisible' ,
233
+ 'test_project_scalevisibility.qgs' )
234
+
220
235
def test_describelayer (self ):
221
236
# Test DescribeLayer
222
237
self .wms_request_compare ('DescribeLayer' ,
0 commit comments