Skip to content

Commit 04cdf49

Browse files
committedSep 29, 2017
Add some tests
1 parent 5230680 commit 04cdf49

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
 

‎tests/src/python/test_qgsserver_wms.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ def test_project_wms(self):
8888
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320',
8989
'wms_getfeatureinfo-text-html')
9090

91+
# Test getfeatureinfo response text
92+
self.wms_request_compare('GetFeatureInfo',
93+
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
94+
'transparent=true&' +
95+
'width=600&height=400&srs=EPSG%3A3857&bbox=913190.6389747962%2C' +
96+
'5606005.488876367%2C913235.426296057%2C5606035.347090538&' +
97+
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320&' +
98+
'info_format=text/plain',
99+
'wms_getfeatureinfo-text-plain')
100+
91101
# Test getfeatureinfo default info_format
92102
self.wms_request_compare('GetFeatureInfo',
93103
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
@@ -97,6 +107,16 @@ def test_project_wms(self):
97107
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320',
98108
'wms_getfeatureinfo-text-plain')
99109

110+
# Test getfeatureinfo invalid info_format
111+
self.wms_request_compare('GetFeatureInfo',
112+
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
113+
'transparent=true&' +
114+
'width=600&height=400&srs=EPSG%3A3857&bbox=913190.6389747962%2C' +
115+
'5606005.488876367%2C913235.426296057%2C5606035.347090538&' +
116+
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320&' +
117+
'info_format=InvalidFormat',
118+
'wms_getfeatureinfo-invalid-format')
119+
100120
# Regression for #8656
101121
# Mind the gap! (the space in the FILTER expression)
102122
self.wms_request_compare('GetFeatureInfo',
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*****
2+
Content-Type: text/xml; charset=utf-8
3+
4+
<ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc">
5+
<ServiceException code="InvalidFormat">Invalid INFO_FORMAT parameter</ServiceException>
6+
</ServiceExceptionReport>

0 commit comments

Comments
 (0)
Please sign in to comment.