Skip to content

Commit 534e1e8

Browse files
committed
Add test
1 parent 39bce94 commit 534e1e8

File tree

3 files changed

+655
-2
lines changed

3 files changed

+655
-2
lines changed

tests/src/python/test_qgsserver_wms.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class TestQgsServerWMS(QgsServerTestBase):
4646
# Set to True to re-generate reference files for this class
4747
regenerate_reference = False
4848

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
5151
assert os.path.exists(project), "Project file not found: " + project
5252

5353
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):
217217
'query_layers=testlayer+%C3%A8%C3%A9&X=190&Y=320',
218218
'wms_getfeatureinfo-text-xml')
219219

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+
220235
def test_describelayer(self):
221236
# Test DescribeLayer
222237
self.wms_request_compare('DescribeLayer',

0 commit comments

Comments
 (0)