Skip to content

Commit 1f862ca

Browse files
committedApr 17, 2019
Waste my time with Travis
1 parent 5cf2596 commit 1f862ca

File tree

8 files changed

+28
-28
lines changed

8 files changed

+28
-28
lines changed
 

‎tests/src/python/test_qgsserver_wms_getlegendgraphic.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,6 @@ def test_getLegendGraphics(self):
6262
self.assertEqual(-1, h.find(b'Content-Type: text/xml; charset=utf-8'), "Header: %s\nResponse:\n%s" % (h, r))
6363
self.assertNotEqual(-1, h.find(b'Content-Type: image/png'), "Header: %s\nResponse:\n%s" % (h, r))
6464

65-
def test_getLegendGraphics_invalid_parameters(self):
66-
"""Test that does return an exception"""
67-
qs = "?" + "&".join(["%s=%s" % i for i in list({
68-
"MAP": urllib.parse.quote(self.projectPath),
69-
"SERVICE": "WMS",
70-
"VERSION": "1.1.1",
71-
"REQUEST": "GetLegendGraphic",
72-
"LAYER": "Country,Hello,db_point",
73-
"LAYERTITLE": "FALSE",
74-
"FORMAT": "image/png",
75-
"HEIGHT": "500",
76-
"WIDTH": "500",
77-
"RULE": "1",
78-
"BBOX": "-151.7,-38.9,51.0,78.0",
79-
"CRS": "EPSG:4326"
80-
}.items())])
81-
82-
r, h = self._result(self._execute_request(qs))
83-
err = b"BBOX parameter cannot be combined with RULE" in r
84-
self.assertTrue(err)
85-
8665
def test_wms_GetLegendGraphic_LayerSpace(self):
8766
qs = "?" + "&".join(["%s=%s" % i for i in list({
8867
"MAP": urllib.parse.quote(self.projectPath),
@@ -107,6 +86,27 @@ def test_wms_GetLegendGraphic_LayerSpace(self):
10786
r, h = self._result(self._execute_request(qs))
10887
self._img_diff_error(r, h, "WMS_GetLegendGraphic_LayerSpace", max_size_diff=QSize(1, 1))
10988

89+
def test_wms_getLegendGraphics_invalid_parameters(self):
90+
"""Test that does return an exception"""
91+
qs = "?" + "&".join(["%s=%s" % i for i in list({
92+
"MAP": urllib.parse.quote(self.projectPath),
93+
"SERVICE": "WMS",
94+
"VERSION": "1.1.1",
95+
"REQUEST": "GetLegendGraphic",
96+
"LAYER": "Country,Hello,db_point",
97+
"LAYERTITLE": "FALSE",
98+
"FORMAT": "image/png",
99+
"HEIGHT": "500",
100+
"WIDTH": "500",
101+
"RULE": "1",
102+
"BBOX": "-151.7,-38.9,51.0,78.0",
103+
"CRS": "EPSG:4326"
104+
}.items())])
105+
106+
r, h = self._result(self._execute_request(qs))
107+
err = b"BBOX parameter cannot be combined with RULE" in r
108+
self.assertTrue(err)
109+
110110
def test_wms_GetLegendGraphic_LayerTitleSpace(self):
111111
qs = "?" + "&".join(["%s=%s" % i for i in list({
112112
"MAP": urllib.parse.quote(self.projectPath),
@@ -155,7 +155,7 @@ def test_wms_GetLegendGraphic_ShowFeatureCount(self):
155155
r, h = self._result(self._execute_request(qs))
156156
self._img_diff_error(r, h, "WMS_GetLegendGraphic_ShowFeatureCount", max_size_diff=QSize(1, 1))
157157

158-
def test_getLegendGraphics_layertitle(self):
158+
def test_wms_getLegendGraphics_layertitle(self):
159159
"""Test that does not return an exception but an image"""
160160

161161
print("TEST FONT FAMILY: ", self.fontFamily)
@@ -196,7 +196,7 @@ def test_getLegendGraphics_layertitle(self):
196196
r, h = self._result(self._execute_request(qs))
197197
self._img_diff_error(r, h, "WMS_GetLegendGraphic_test_layertitle_false", 250, QSize(15, 15))
198198

199-
def test_getLegendGraphics_rulelabel(self):
199+
def test_wms_getLegendGraphics_rulelabel(self):
200200
"""Test that does not return an exception but an image"""
201201
parms = {
202202
'MAP': self.testdata_path + "test_project.qgs",
@@ -236,7 +236,7 @@ def test_getLegendGraphics_rulelabel(self):
236236
r, h = self._result(self._execute_request(qs))
237237
self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_false", 250, QSize(15, 15))
238238

239-
def test_getLegendGraphics_rule(self):
239+
def test_wms_getLegendGraphics_rule(self):
240240
"""Test that does not return an exception but an image"""
241241
parms = {
242242
'MAP': self.testdata_path + "test_project_legend_rule.qgs",
@@ -751,7 +751,7 @@ def test_wms_GetLegendGraphic_LAYERFONTCOLOR(self):
751751
}.items())])
752752

753753
r, h = self._result(self._execute_request(qs))
754-
self._img_diff_error(r, h, "WMS_GetLegendGraphic_LAYERFONTCOLOR")
754+
self._img_diff_error(r, h, "WMS_GetLegendGraphic_LAYERFONTCOLOR", max_size_diff=QSize(10, 2))
755755

756756
def test_wms_GetLegendGraphic_ITEMFONTCOLOR(self):
757757
qs = "?" + "&".join(["%s=%s" % i for i in list({
@@ -768,7 +768,7 @@ def test_wms_GetLegendGraphic_ITEMFONTCOLOR(self):
768768
}.items())])
769769

770770
r, h = self._result(self._execute_request(qs))
771-
self._img_diff_error(r, h, "WMS_GetLegendGraphic_ITEMFONTCOLOR")
771+
self._img_diff_error(r, h, "WMS_GetLegendGraphic_ITEMFONTCOLOR", max_size_diff=QSize(10, 2))
772772

773773
def test_wms_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR(self):
774774
qs = "?" + "&".join(["%s=%s" % i for i in list({
@@ -786,7 +786,7 @@ def test_wms_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR(self):
786786
}.items())])
787787

788788
r, h = self._result(self._execute_request(qs))
789-
self._img_diff_error(r, h, "WMS_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR")
789+
self._img_diff_error(r, h, "WMS_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR", max_size_diff=QSize(10, 2))
790790

791791
def test_wms_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR_hex(self):
792792
qs = "?" + "&".join(["%s=%s" % i for i in list({
@@ -804,7 +804,7 @@ def test_wms_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR_hex(self):
804804
}.items())])
805805

806806
r, h = self._result(self._execute_request(qs))
807-
self._img_diff_error(r, h, "WMS_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR")
807+
self._img_diff_error(r, h, "WMS_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR", max_size_diff=QSize(10, 2))
808808

809809

810810
if __name__ == '__main__':
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.