Skip to content

Commit

Permalink
Add test for maptip
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Oct 27, 2017
1 parent e03461d commit 52896f5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/src/python/test_qgsserver_wms.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ def test_getfeatureinfo(self):
'with_geometry=true',
'wms_getfeatureinfo-text-html-geometry')

#Test getfeatureinfo response html with maptip
self.wms_request_compare('GetFeatureInfo',
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
'info_format=text%2Fhtml&transparent=true&' +
'width=600&height=400&srs=EPSG%3A3857&bbox=913190.6389747962%2C' +
'5606005.488876367%2C913235.426296057%2C5606035.347090538&' +
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320&' +
'with_maptip=true',
'wms_getfeatureinfo-text-html-maptip')

# Test getfeatureinfo response text
self.wms_request_compare('GetFeatureInfo',
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
Expand Down
1 change: 1 addition & 0 deletions tests/testdata/qgis_server/test_project.qgs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@
<rowstyles/>
<fieldstyles/>
</conditionalstyles>
<mapTip>[% 'Name: ' || "name" %]</mapTip>
</maplayer>
</projectlayers>
<properties>
Expand Down
21 changes: 21 additions & 0 deletions tests/testdata/qgis_server/wms_getfeatureinfo-text-html-maptip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Content-Length: 512
Content-Type: text/html; charset=utf-8

<HEAD>
<TITLE> GetFeatureInfo results </TITLE>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</HEAD>
<BODY>
<TABLE border=1 width=100%>
<TR><TH width=25%>Layer</TH><TD>testlayer èé</TD></TR>
</BR><TABLE border=1 width=100%>
<TR><TH>Feature</TH><TD>2</TD></TR>
<TR><TH>id</TH><TD>3</TD></TR>
<TR><TH>name</TH><TD>three</TD></TR>
<TR><TH>utf8nameè</TH><TD>three èé↓</TD></TR>
<TR><TH>maptip</TH><TD>Name: three</TD></TR>
</TABLE>
</BR>
</TABLE>
<BR></BR>
</BODY>

0 comments on commit 52896f5

Please sign in to comment.