Add unit test for HTML format

This commit is contained in:
Blottiere Paul 2020-09-28 11:05:59 +02:00
parent cd2032ff45
commit 636942aae3
7 changed files with 92 additions and 6 deletions

View File

@ -803,7 +803,7 @@ class TestQgsServerWMSGetFeatureInfo(TestQgsServerWMSTestBase):
project_name)
def testGetFeatureInfoRasterNoData(self):
# out
# out text
self.wms_request_compare('GetFeatureInfo',
'&BBOX=-39.43236293126383885,135.95002698514588246,-30.54405018572365194,156.29582900705395332' +
'&CRS=EPSG:4326' +
@ -813,11 +813,11 @@ class TestQgsServerWMSGetFeatureInfo(TestQgsServerWMSTestBase):
'&QUERY_LAYERS=requires_warped_vrt' +
'&I=1&J=1' +
'&FEATURE_COUNT=10',
'wms_getfeatureinfo_raster_nodata_out',
'wms_getfeatureinfo_raster_nodata_out_txt',
'test_raster_nodata.qgz',
normalizeJson=True)
# 0
# 0 text
self.wms_request_compare('GetFeatureInfo',
'&BBOX=-39.43236293126383885,135.95002698514588246,-30.54405018572365194,156.29582900705395332' +
'&CRS=EPSG:4326' +
@ -827,11 +827,11 @@ class TestQgsServerWMSGetFeatureInfo(TestQgsServerWMSTestBase):
'&QUERY_LAYERS=requires_warped_vrt' +
'&I=576&J=163' +
'&FEATURE_COUNT=10',
'wms_getfeatureinfo_raster_nodata_zero',
'wms_getfeatureinfo_raster_nodata_zero_txt',
'test_raster_nodata.qgz',
normalizeJson=True)
# nodata
# nodata text
self.wms_request_compare('GetFeatureInfo',
'&BBOX=-39.43236293126383885,135.95002698514588246,-30.54405018572365194,156.29582900705395332' +
'&CRS=EPSG:4326' +
@ -841,7 +841,52 @@ class TestQgsServerWMSGetFeatureInfo(TestQgsServerWMSTestBase):
'&QUERY_LAYERS=requires_warped_vrt' +
'&I=560&J=78' +
'&FEATURE_COUNT=10',
'wms_getfeatureinfo_raster_nodata',
'wms_getfeatureinfo_raster_nodata_txt',
'test_raster_nodata.qgz',
normalizeJson=True)
# out html
self.wms_request_compare('GetFeatureInfo',
'&BBOX=-39.43236293126383885,135.95002698514588246,-30.54405018572365194,156.29582900705395332' +
'&CRS=EPSG:4326' +
'&VERSION=1.3.0' +
'&INFO_FORMAT=text/html' +
'&WIDTH=800&HEIGHT=400' +
'&LAYERS=requires_warped_vrt' +
'&QUERY_LAYERS=requires_warped_vrt' +
'&I=1&J=1' +
'&FEATURE_COUNT=10',
'wms_getfeatureinfo_raster_nodata_out_html',
'test_raster_nodata.qgz',
normalizeJson=True)
# 0 html
self.wms_request_compare('GetFeatureInfo',
'&BBOX=-39.43236293126383885,135.95002698514588246,-30.54405018572365194,156.29582900705395332' +
'&CRS=EPSG:4326' +
'&VERSION=1.3.0' +
'&INFO_FORMAT=text/html' +
'&WIDTH=800&HEIGHT=400' +
'&LAYERS=requires_warped_vrt' +
'&QUERY_LAYERS=requires_warped_vrt' +
'&I=576&J=163' +
'&FEATURE_COUNT=10',
'wms_getfeatureinfo_raster_nodata_zero_html',
'test_raster_nodata.qgz',
normalizeJson=True)
# nodata html
self.wms_request_compare('GetFeatureInfo',
'&BBOX=-39.43236293126383885,135.95002698514588246,-30.54405018572365194,156.29582900705395332' +
'&CRS=EPSG:4326' +
'&VERSION=1.3.0' +
'&INFO_FORMAT=text/html' +
'&WIDTH=800&HEIGHT=400' +
'&LAYERS=requires_warped_vrt' +
'&QUERY_LAYERS=requires_warped_vrt' +
'&I=560&J=78' +
'&FEATURE_COUNT=10',
'wms_getfeatureinfo_raster_nodata_html',
'test_raster_nodata.qgz',
normalizeJson=True)

View File

@ -0,0 +1,14 @@
*****
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>requires_warped_vrt</TD></TR>
</BR><TR><TH>Band 1</TH><TD>no data</TD></TR>
</TABLE>
<BR></BR>
</BODY>

View File

@ -0,0 +1,13 @@
*****
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>requires_warped_vrt</TD></TR>
</BR></TABLE>
<BR></BR>
</BODY>

View File

@ -0,0 +1,14 @@
*****
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>requires_warped_vrt</TD></TR>
</BR><TR><TH>Band 1</TH><TD>0</TD></TR>
</TABLE>
<BR></BR>
</BODY>