|
40 | 40 |
|
41 | 41 |
|
42 | 42 | class TestQgsServerWMSGetLegendGraphic(QgsServerTestBase): |
43 | | - |
44 | 43 | """QGIS Server WMS Tests for GetLegendGraphic request""" |
45 | 44 |
|
| 45 | + # Set to True to re-generate reference files for this class |
| 46 | + #regenerate_reference = True |
| 47 | + |
46 | 48 | def test_getLegendGraphics(self): |
47 | 49 | """Test that does not return an exception but an image""" |
48 | 50 | parms = { |
@@ -103,7 +105,31 @@ def test_wms_GetLegendGraphic_LayerSpace(self): |
103 | 105 | }.items())]) |
104 | 106 |
|
105 | 107 | r, h = self._result(self._execute_request(qs)) |
106 | | - self._img_diff_error(r, h, "WMS_GetLegendGraphic_LayerSpace") |
| 108 | + self._img_diff_error(r, h, "WMS_GetLegendGraphic_LayerSpace", max_size_diff=QSize(1, 1)) |
| 109 | + |
| 110 | + def test_wms_GetLegendGraphic_LayerTitleSpace(self): |
| 111 | + qs = "?" + "&".join(["%s=%s" % i for i in list({ |
| 112 | + "MAP": urllib.parse.quote(self.projectPath), |
| 113 | + "SERVICE": "WMS", |
| 114 | + "VERSION": "1.1.1", |
| 115 | + "REQUEST": "GetLegendGraphic", |
| 116 | + "LAYER": "Country,Hello", |
| 117 | + "FORMAT": "image/png", |
| 118 | + # "HEIGHT": "500", |
| 119 | + # "WIDTH": "500", |
| 120 | + "LAYERTITLESPACE": "20.0", |
| 121 | + "LAYERFONTBOLD": "TRUE", |
| 122 | + "LAYERFONTSIZE": "30", |
| 123 | + "ITEMFONTBOLD": "TRUE", |
| 124 | + "ITEMFONTSIZE": "20", |
| 125 | + "LAYERFONTFAMILY": self.fontFamily, |
| 126 | + "ITEMFONTFAMILY": self.fontFamily, |
| 127 | + "LAYERTITLE": "TRUE", |
| 128 | + "CRS": "EPSG:3857" |
| 129 | + }.items())]) |
| 130 | + |
| 131 | + r, h = self._result(self._execute_request(qs)) |
| 132 | + self._img_diff_error(r, h, "WMS_GetLegendGraphic_LayerTitleSpace") |
107 | 133 |
|
108 | 134 | def test_wms_GetLegendGraphic_ShowFeatureCount(self): |
109 | 135 | qs = "?" + "&".join(["%s=%s" % i for i in list({ |
|
0 commit comments