Skip to content

Commit 10e8807

Browse files
committed
[server] Added regression test for #8656
Ref. commit b956874
1 parent 5cfcf84 commit 10e8807

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

tests/src/python/test_qgsserver.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def wms_request_compare(self, request, extra=None, reference_file=None):
155155
query_string = 'MAP=%s&SERVICE=WMS&VERSION=1.3&REQUEST=%s' % (urllib.quote(project), request)
156156
if extra is not None:
157157
query_string += extra
158+
print query_string
158159
header, body = [str(_v) for _v in self.server.handleRequest(query_string)]
159160
response = header + body
160161
f = open(self.testdata_path + (request.lower() if not reference_file else reference_file) + '.txt')
@@ -168,7 +169,7 @@ def wms_request_compare(self, request, extra=None, reference_file=None):
168169
f = open(os.path.dirname(__file__) + '/response.txt', 'w+')
169170
f.write(response)
170171
f.close()
171-
"""
172+
#"""
172173
response = re.sub(RE_STRIP_PATH, '', response)
173174
expected = re.sub(RE_STRIP_PATH, '', expected)
174175

@@ -201,6 +202,17 @@ def test_project_wms(self):
201202
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320',
202203
'wms_getfeatureinfo-text-plain')
203204

205+
206+
# Regression for #8656
207+
# Mind the gap! (the space in the FILTER expression)
208+
self.wms_request_compare('GetFeatureInfo',
209+
'&layers=testlayer%20%C3%A8%C3%A9&' +
210+
'INFO_FORMAT=text%2Fxml&' +
211+
'width=600&height=400&srs=EPSG%3A3857&' +
212+
'query_layers=testlayer%20%C3%A8%C3%A9&' +
213+
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.quote(':"NAME" = \'two\''),
214+
'wms_getfeatureinfo_filter')
215+
204216
def wms_inspire_request_compare(self, request):
205217
"""WMS INSPIRE tests"""
206218
project = self.testdata_path + "test+project_inspire.qgs"
@@ -306,7 +318,7 @@ def test_getLegendGraphics(self):
306318
parms = {
307319
'MAP': self.testdata_path + "test%2Bproject.qgs",
308320
'SERVICE': 'WMS',
309-
'VERSIONE': '1.0.0',
321+
'VERSION': '1.0.0',
310322
'REQUEST': 'GetLegendGraphic',
311323
'FORMAT': 'image/png',
312324
#'WIDTH': '20', # optional
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Content-Length: 577
2+
Content-Type: text/xml; charset=utf-8
3+
4+
<GetFeatureInfoResponse>
5+
<BoundingBox CRS="EPSG:3857" maxx="913214.67407005" minx="913214.67407005" maxy="5606017.87425818" miny="5606017.87425818"/>
6+
<Layer name="testlayer èé">
7+
<Feature id="1">
8+
<Attribute value="2" name="id"/>
9+
<Attribute value="two" name="name"/>
10+
<Attribute value="two àò" name="utf8nameè"/>
11+
<BoundingBox CRS="EPSG:3857" maxx="913214.6741" minx="913214.6741" maxy="5606017.8743" miny="5606017.8743"/>
12+
<Attribute value="Point (913214.6741 5606017.8743)" type="derived" name="geometry"/>
13+
</Feature>
14+
</Layer>
15+
</GetFeatureInfoResponse>

0 commit comments

Comments
 (0)