Skip to content

Commit ebea9ce

Browse files
committedMay 12, 2020
Adding 2 tests for WMS GetLegendGraphics if rulelabel is not set
1 parent f5294db commit ebea9ce

File tree

5 files changed

+32
-0
lines changed

5 files changed

+32
-0
lines changed
 

‎tests/src/python/test_qgsserver_wms_getlegendgraphic.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,38 @@ def test_wms_getLegendGraphics_rulelabel(self):
260260
r, h = self._result(self._execute_request(qs))
261261
self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_true", 250, QSize(15, 15))
262262

263+
# LAYERTITLE false and no set of RULELABEL means it is false for single symbol
264+
parms = {
265+
'MAP': self.testdata_path + "test_project.qgs",
266+
'SERVICE': 'WMS',
267+
'VERSION': '1.3.0',
268+
'REQUEST': 'GetLegendGraphic',
269+
'FORMAT': 'image/png',
270+
'LAYER': u'testlayer%20èé',
271+
'LAYERTITLE': 'FALSE'
272+
}
273+
qs = '?' + '&'.join([u"%s=%s" % (k, v) for k, v in parms.items()])
274+
r, h = self._result(self._execute_request(qs))
275+
self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_notset0", 250, QSize(15, 15))
276+
277+
# LAYERTITLE false and no set of RULELABEL means it is true for legend other than single symbol
278+
parms = {
279+
'MAP': self.testdata_path + "test_project_legend_rule.qgs",
280+
'SERVICE': 'WMS',
281+
'VERSION': '1.3.0',
282+
'REQUEST': 'GetLegendGraphic',
283+
'FORMAT': 'image/png',
284+
'LAYER': u'testlayer%20èé',
285+
'ITEMFONTBOLD': 'TRUE',
286+
'ITEMFONTSIZE': '20',
287+
'LAYERFONTFAMILY': self.fontFamily,
288+
'ITEMFONTFAMILY': self.fontFamily,
289+
'LAYERTITLE': 'FALSE'
290+
}
291+
qs = '?' + '&'.join([u"%s=%s" % (k, v) for k, v in parms.items()])
292+
r, h = self._result(self._execute_request(qs))
293+
self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_notset1", 250, QSize(15, 15))
294+
263295
def test_wms_getLegendGraphics_rule(self):
264296
"""Test that does not return an exception but an image"""
265297
parms = {

0 commit comments

Comments
 (0)
Please sign in to comment.