Skip to content

Commit

Permalink
Revert test for rulelabel not set, add new rulelabel=auto test, clean…
Browse files Browse the repository at this point in the history
… data from previous commits
  • Loading branch information
uprel committed May 12, 2020
1 parent f957b9f commit c79a40f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions tests/src/python/test_qgsserver_wms_getlegendgraphic.py
Expand Up @@ -260,37 +260,40 @@ 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
# no set of RULELABEL means it is true
parms = {
'MAP': self.testdata_path + "test_project.qgs",
'SERVICE': 'WMS',
'VERSION': '1.3.0',
'REQUEST': 'GetLegendGraphic',
'FORMAT': 'image/png',
'LAYER': u'testlayer%20èé',
'LAYERFONTBOLD': 'TRUE',
'LAYERFONTSIZE': '30',
'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_notset0", 250, QSize(15, 15))
self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_notset", 250, QSize(15, 15))

# LAYERTITLE false and no set of RULELABEL means it is true for legend other than single symbol
# RULELABEL AUTO for single symbol means it is removed
parms = {
'MAP': self.testdata_path + "test_project_legend_rule.qgs",
'MAP': self.testdata_path + "test_project.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'
'LAYERTITLE': 'FALSE',
'RULELABEL': 'AUTO'
}
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))
self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_auto", 250, QSize(15, 15))

def test_wms_getLegendGraphics_rule(self):
"""Test that does not return an exception but an image"""
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.
Binary file not shown.
Binary file not shown.

0 comments on commit c79a40f

Please sign in to comment.