Skip to content

Commit

Permalink
Adding 2 tests for WMS GetLegendGraphics if rulelabel is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
uprel committed May 12, 2020
1 parent f5294db commit ebea9ce
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/src/python/test_qgsserver_wms_getlegendgraphic.py
Expand Up @@ -260,6 +260,38 @@ def test_wms_getLegendGraphics_rulelabel(self):
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_true", 250, QSize(15, 15))

# LAYERTITLE false and no set of RULELABEL means it is false for single symbol
parms = {
'MAP': self.testdata_path + "test_project.qgs",
'SERVICE': 'WMS',
'VERSION': '1.3.0',
'REQUEST': 'GetLegendGraphic',
'FORMAT': 'image/png',
'LAYER': u'testlayer%20èé',
'LAYERTITLE': 'FALSE'
}
qs = '?' + '&'.join([u"%s=%s" % (k, v) for k, v in parms.items()])
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_notset0", 250, QSize(15, 15))

# LAYERTITLE false and no set of RULELABEL means it is true for legend other than single symbol
parms = {
'MAP': self.testdata_path + "test_project_legend_rule.qgs",
'SERVICE': 'WMS',
'VERSION': '1.3.0',
'REQUEST': 'GetLegendGraphic',
'FORMAT': 'image/png',
'LAYER': u'testlayer%20èé',
'ITEMFONTBOLD': 'TRUE',
'ITEMFONTSIZE': '20',
'LAYERFONTFAMILY': self.fontFamily,
'ITEMFONTFAMILY': self.fontFamily,
'LAYERTITLE': 'FALSE'
}
qs = '?' + '&'.join([u"%s=%s" % (k, v) for k, v in parms.items()])
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_notset1", 250, QSize(15, 15))

def test_wms_getLegendGraphics_rule(self):
"""Test that does not return an exception but an image"""
parms = {
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ebea9ce

Please sign in to comment.