@@ -62,27 +62,6 @@ def test_getLegendGraphics(self):
62
62
self .assertEqual (- 1 , h .find (b'Content-Type: text/xml; charset=utf-8' ), "Header: %s\n Response:\n %s" % (h , r ))
63
63
self .assertNotEqual (- 1 , h .find (b'Content-Type: image/png' ), "Header: %s\n Response:\n %s" % (h , r ))
64
64
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
-
86
65
def test_wms_GetLegendGraphic_LayerSpace (self ):
87
66
qs = "?" + "&" .join (["%s=%s" % i for i in list ({
88
67
"MAP" : urllib .parse .quote (self .projectPath ),
@@ -107,6 +86,27 @@ def test_wms_GetLegendGraphic_LayerSpace(self):
107
86
r , h = self ._result (self ._execute_request (qs ))
108
87
self ._img_diff_error (r , h , "WMS_GetLegendGraphic_LayerSpace" , max_size_diff = QSize (1 , 1 ))
109
88
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
+
110
110
def test_wms_GetLegendGraphic_LayerTitleSpace (self ):
111
111
qs = "?" + "&" .join (["%s=%s" % i for i in list ({
112
112
"MAP" : urllib .parse .quote (self .projectPath ),
@@ -155,7 +155,7 @@ def test_wms_GetLegendGraphic_ShowFeatureCount(self):
155
155
r , h = self ._result (self ._execute_request (qs ))
156
156
self ._img_diff_error (r , h , "WMS_GetLegendGraphic_ShowFeatureCount" , max_size_diff = QSize (1 , 1 ))
157
157
158
- def test_getLegendGraphics_layertitle (self ):
158
+ def test_wms_getLegendGraphics_layertitle (self ):
159
159
"""Test that does not return an exception but an image"""
160
160
161
161
print ("TEST FONT FAMILY: " , self .fontFamily )
@@ -196,7 +196,7 @@ def test_getLegendGraphics_layertitle(self):
196
196
r , h = self ._result (self ._execute_request (qs ))
197
197
self ._img_diff_error (r , h , "WMS_GetLegendGraphic_test_layertitle_false" , 250 , QSize (15 , 15 ))
198
198
199
- def test_getLegendGraphics_rulelabel (self ):
199
+ def test_wms_getLegendGraphics_rulelabel (self ):
200
200
"""Test that does not return an exception but an image"""
201
201
parms = {
202
202
'MAP' : self .testdata_path + "test_project.qgs" ,
@@ -236,7 +236,7 @@ def test_getLegendGraphics_rulelabel(self):
236
236
r , h = self ._result (self ._execute_request (qs ))
237
237
self ._img_diff_error (r , h , "WMS_GetLegendGraphic_rulelabel_false" , 250 , QSize (15 , 15 ))
238
238
239
- def test_getLegendGraphics_rule (self ):
239
+ def test_wms_getLegendGraphics_rule (self ):
240
240
"""Test that does not return an exception but an image"""
241
241
parms = {
242
242
'MAP' : self .testdata_path + "test_project_legend_rule.qgs" ,
@@ -751,7 +751,7 @@ def test_wms_GetLegendGraphic_LAYERFONTCOLOR(self):
751
751
}.items ())])
752
752
753
753
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 ) )
755
755
756
756
def test_wms_GetLegendGraphic_ITEMFONTCOLOR (self ):
757
757
qs = "?" + "&" .join (["%s=%s" % i for i in list ({
@@ -768,7 +768,7 @@ def test_wms_GetLegendGraphic_ITEMFONTCOLOR(self):
768
768
}.items ())])
769
769
770
770
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 ) )
772
772
773
773
def test_wms_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR (self ):
774
774
qs = "?" + "&" .join (["%s=%s" % i for i in list ({
@@ -786,7 +786,7 @@ def test_wms_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR(self):
786
786
}.items ())])
787
787
788
788
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 ) )
790
790
791
791
def test_wms_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR_hex (self ):
792
792
qs = "?" + "&" .join (["%s=%s" % i for i in list ({
@@ -804,7 +804,7 @@ def test_wms_GetLegendGraphic_ITEMFONTCOLOR_and_LAYERFONTCOLOR_hex(self):
804
804
}.items ())])
805
805
806
806
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 ) )
808
808
809
809
810
810
if __name__ == '__main__' :
0 commit comments