Skip to content
Permalink
Browse files

Add unit test for HTML format

  • Loading branch information
pblottiere committed Sep 28, 2020
1 parent cd2032f commit 636942aae3e9453c5cdeb0353bda4530bcf17245
@@ -803,7 +803,7 @@ def testGetFeatureInfoCascadingLayers(self):
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 @@ def testGetFeatureInfoRasterNoData(self):
'&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 @@ def testGetFeatureInfoRasterNoData(self):
'&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 @@ def testGetFeatureInfoRasterNoData(self):
'&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)

@@ -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>
@@ -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>
@@ -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>

0 comments on commit 636942a

Please sign in to comment.
You can’t perform that action at this time.