[Server] WMS GetPrint refactoring - Update tests
@ -1302,6 +1302,70 @@ class TestQgsServerWMS(QgsServerTestBase):
|
||||
r, h = self._result(self._execute_request(qs))
|
||||
self._img_diff_error(r, h, "WMS_GetPrint_Selection")
|
||||
|
||||
def test_wms_getprint_highlight(self):
|
||||
# default style
|
||||
qs = "?" + "&".join(["%s=%s" % i for i in list({
|
||||
"MAP": urllib.parse.quote(self.projectPath),
|
||||
"SERVICE": "WMS",
|
||||
"VERSION": "1.1.1",
|
||||
"REQUEST": "GetPrint",
|
||||
"TEMPLATE": "layoutA4",
|
||||
"FORMAT": "png",
|
||||
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
|
||||
"map0:LAYERS": "Country_Labels",
|
||||
"map0:HIGHLIGHT_GEOM": "POLYGON((-15000000 10000000, -15000000 6110620, 2500000 6110620, 2500000 10000000, -15000000 10000000))",
|
||||
"map0:HIGHLIGHT_SYMBOL": "<StyledLayerDescriptor><UserStyle><Name>Highlight</Name><FeatureTypeStyle><Rule><Name>Symbol</Name><LineSymbolizer><Stroke><SvgParameter name=\"stroke\">%23ea1173</SvgParameter><SvgParameter name=\"stroke-opacity\">1</SvgParameter><SvgParameter name=\"stroke-width\">1.6</SvgParameter></Stroke></LineSymbolizer></Rule></FeatureTypeStyle></UserStyle></StyledLayerDescriptor>",
|
||||
"map0:HIGHLIGHT_LABELSTRING": "Highlight Layer!",
|
||||
"map0:HIGHLIGHT_LABELSIZE": "16",
|
||||
"map0:HIGHLIGHT_LABELCOLOR": "%2300FF0000",
|
||||
"map0:HIGHLIGHT_LABELBUFFERCOLOR": "%232300FF00",
|
||||
"map0:HIGHLIGHT_LABELBUFFERSIZE": "1.5",
|
||||
"HEIGHT": "500",
|
||||
"WIDTH": "500",
|
||||
"CRS": "EPSG:3857"
|
||||
}.items())])
|
||||
|
||||
r, h = self._result(self._execute_request(qs))
|
||||
assert h.get("Content-Type").startswith('image'), r
|
||||
self._img_diff_error(r, h, "WMS_GetPrint_Highlight")
|
||||
|
||||
def test_wms_getprint_label(self):
|
||||
qs = "?" + "&".join(["%s=%s" % i for i in list({
|
||||
"MAP": urllib.parse.quote(self.projectPath),
|
||||
"SERVICE": "WMS",
|
||||
"VERSION": "1.1.1",
|
||||
"REQUEST": "GetPrint",
|
||||
"TEMPLATE": "layoutA4",
|
||||
"FORMAT": "png",
|
||||
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
|
||||
"map0:LAYERS": "Country,Hello",
|
||||
"HEIGHT": "500",
|
||||
"WIDTH": "500",
|
||||
"CRS": "EPSG:3857",
|
||||
"IDTEXTBOX": "Updated QGIS composer label"
|
||||
}.items())])
|
||||
|
||||
r, h = self._result(self._execute_request(qs))
|
||||
self._img_diff_error(r, h, "WMS_GetPrint_LabelUpdated")
|
||||
|
||||
qs = "?" + "&".join(["%s=%s" % i for i in list({
|
||||
"MAP": urllib.parse.quote(self.projectPath),
|
||||
"SERVICE": "WMS",
|
||||
"VERSION": "1.1.1",
|
||||
"REQUEST": "GetPrint",
|
||||
"TEMPLATE": "layoutA4",
|
||||
"FORMAT": "png",
|
||||
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
|
||||
"map0:LAYERS": "Country,Hello",
|
||||
"HEIGHT": "500",
|
||||
"WIDTH": "500",
|
||||
"CRS": "EPSG:3857",
|
||||
"IDTEXTBOX": ""
|
||||
}.items())])
|
||||
|
||||
r, h = self._result(self._execute_request(qs))
|
||||
self._img_diff_error(r, h, "WMS_GetPrint_LabelRemoved")
|
||||
|
||||
def test_getLegendGraphics(self):
|
||||
"""Test that does not return an exception but an image"""
|
||||
parms = {
|
||||
|
BIN
tests/testdata/control_images/qgis_server/WMS_GetPrint_Highlight/WMS_GetPrint_Highlight.png
vendored
Normal file
After Width: | Height: | Size: 238 KiB |
BIN
tests/testdata/control_images/qgis_server/WMS_GetPrint_Highlight/WMS_GetPrint_Highlight_mask.png
vendored
Normal file
After Width: | Height: | Size: 103 KiB |
BIN
tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelRemoved/WMS_GetPrint_LabelRemoved.png
vendored
Normal file
After Width: | Height: | Size: 286 KiB |
After Width: | Height: | Size: 47 KiB |
BIN
tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelUpdated/WMS_GetPrint_LabelUpdated.png
vendored
Normal file
After Width: | Height: | Size: 272 KiB |
After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 304 KiB After Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 318 KiB After Width: | Height: | Size: 297 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 250 KiB |
Before Width: | Height: | Size: 252 KiB After Width: | Height: | Size: 226 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 71 KiB |