Skip to content

Commit

Permalink
[server] Added regression test for #8656
Browse files Browse the repository at this point in the history
Ref. commit b956874
  • Loading branch information
elpaso committed May 20, 2016
1 parent 5cfcf84 commit 10e8807
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/src/python/test_qgsserver.py
Expand Up @@ -155,6 +155,7 @@ def wms_request_compare(self, request, extra=None, reference_file=None):
query_string = 'MAP=%s&SERVICE=WMS&VERSION=1.3&REQUEST=%s' % (urllib.quote(project), request)
if extra is not None:
query_string += extra
print query_string
header, body = [str(_v) for _v in self.server.handleRequest(query_string)]
response = header + body
f = open(self.testdata_path + (request.lower() if not reference_file else reference_file) + '.txt')
Expand All @@ -168,7 +169,7 @@ def wms_request_compare(self, request, extra=None, reference_file=None):
f = open(os.path.dirname(__file__) + '/response.txt', 'w+')
f.write(response)
f.close()
"""
#"""
response = re.sub(RE_STRIP_PATH, '', response)
expected = re.sub(RE_STRIP_PATH, '', expected)

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


# Regression for #8656
# Mind the gap! (the space in the FILTER expression)
self.wms_request_compare('GetFeatureInfo',
'&layers=testlayer%20%C3%A8%C3%A9&' +
'INFO_FORMAT=text%2Fxml&' +
'width=600&height=400&srs=EPSG%3A3857&' +
'query_layers=testlayer%20%C3%A8%C3%A9&' +
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.quote(':"NAME" = \'two\''),
'wms_getfeatureinfo_filter')

def wms_inspire_request_compare(self, request):
"""WMS INSPIRE tests"""
project = self.testdata_path + "test+project_inspire.qgs"
Expand Down Expand Up @@ -306,7 +318,7 @@ def test_getLegendGraphics(self):
parms = {
'MAP': self.testdata_path + "test%2Bproject.qgs",
'SERVICE': 'WMS',
'VERSIONE': '1.0.0',
'VERSION': '1.0.0',
'REQUEST': 'GetLegendGraphic',
'FORMAT': 'image/png',
#'WIDTH': '20', # optional
Expand Down
15 changes: 15 additions & 0 deletions tests/testdata/qgis_server/wms_getfeatureinfo_filter.txt
@@ -0,0 +1,15 @@
Content-Length: 577
Content-Type: text/xml; charset=utf-8

<GetFeatureInfoResponse>
<BoundingBox CRS="EPSG:3857" maxx="913214.67407005" minx="913214.67407005" maxy="5606017.87425818" miny="5606017.87425818"/>
<Layer name="testlayer èé">
<Feature id="1">
<Attribute value="2" name="id"/>
<Attribute value="two" name="name"/>
<Attribute value="two àò" name="utf8nameè"/>
<BoundingBox CRS="EPSG:3857" maxx="913214.6741" minx="913214.6741" maxy="5606017.8743" miny="5606017.8743"/>
<Attribute value="Point (913214.6741 5606017.8743)" type="derived" name="geometry"/>
</Feature>
</Layer>
</GetFeatureInfoResponse>

0 comments on commit 10e8807

Please sign in to comment.