@@ -555,6 +555,106 @@ def test_wms_GetLegendGraphic_wmsRootName(self):
555
555
self .assertEqual (- 1 , h .find (b'Content-Type: text/xml; charset=utf-8' ), "Header: %s\n Response:\n %s" % (h , r ))
556
556
self .assertNotEqual (- 1 , h .find (b'Content-Type: image/png' ), "Header: %s\n Response:\n %s" % (h , r ))
557
557
558
+ def test_wms_GetLegendGraphic_ScaleSymbol_Min (self ):
559
+ # 1:500000000 min
560
+ qs = "?" + "&" .join (["%s=%s" % i for i in list ({
561
+ "MAP" : self .testdata_path + 'test_project_scaledsymbols.qgs' ,
562
+ "SERVICE" : "WMS" ,
563
+ "REQUEST" : "GetLegendGraphic" ,
564
+ "LAYER" : "testlayer" ,
565
+ "FORMAT" : "image/png" ,
566
+ "HEIGHT" : "550" ,
567
+ "WIDTH" : "850" ,
568
+ "BBOX" : "-608.4,-1002.6,698.2,1019.0" ,
569
+ "CRS" : "EPSG:4326"
570
+ }.items ())])
571
+
572
+ r , h = self ._result (self ._execute_request (qs ))
573
+ self ._img_diff_error (r , h , "WMS_GetLegendGraphic_ScaleSymbol_Min" , max_size_diff = QSize (1 , 1 ))
574
+
575
+ # 1:1000000000 min
576
+ qs = "?" + "&" .join (["%s=%s" % i for i in list ({
577
+ "MAP" : self .testdata_path + 'test_project_scaledsymbols.qgs' ,
578
+ "SERVICE" : "WMS" ,
579
+ "REQUEST" : "GetLegendGraphic" ,
580
+ "LAYER" : "testlayer" ,
581
+ "FORMAT" : "image/png" ,
582
+ "HEIGHT" : "550" ,
583
+ "WIDTH" : "850" ,
584
+ "BBOX" : "-1261.7,-2013.5,1351.5,2029.9" ,
585
+ "CRS" : "EPSG:4326"
586
+ }.items ())])
587
+
588
+ r , h = self ._result (self ._execute_request (qs ))
589
+ self ._img_diff_error (r , h , "WMS_GetLegendGraphic_ScaleSymbol_Min" , max_size_diff = QSize (15 , 15 ))
590
+
591
+ def test_wms_GetLegendGraphic_ScaleSymbol_Scaled_01 (self ):
592
+ # 1:10000000 scaled
593
+ qs = "?" + "&" .join (["%s=%s" % i for i in list ({
594
+ "MAP" : self .testdata_path + 'test_project_scaledsymbols.qgs' ,
595
+ "SERVICE" : "WMS" ,
596
+ "REQUEST" : "GetLegendGraphic" ,
597
+ "LAYER" : "testlayer" ,
598
+ "FORMAT" : "image/png" ,
599
+ "HEIGHT" : "550" ,
600
+ "WIDTH" : "850" ,
601
+ "BBOX" : "31.8,-12.0,58.0,28.4" ,
602
+ "CRS" : "EPSG:4326"
603
+ }.items ())])
604
+
605
+ r , h = self ._result (self ._execute_request (qs ))
606
+ self ._img_diff_error (r , h , "WMS_GetLegendGraphic_ScaleSymbol_Scaled_01" , max_size_diff = QSize (15 , 15 ))
607
+
608
+ def test_wms_GetLegendGraphic_ScaleSymbol_Scaled_02 (self ):
609
+ # 1:15000000 scaled
610
+ qs = "?" + "&" .join (["%s=%s" % i for i in list ({
611
+ "MAP" : self .testdata_path + 'test_project_scaledsymbols.qgs' ,
612
+ "SERVICE" : "WMS" ,
613
+ "REQUEST" : "GetLegendGraphic" ,
614
+ "LAYER" : "testlayer" ,
615
+ "FORMAT" : "image/png" ,
616
+ "HEIGHT" : "550" ,
617
+ "WIDTH" : "850" ,
618
+ "BBOX" : "25.3,-22.1,64.5,38.5" ,
619
+ "CRS" : "EPSG:4326"
620
+ }.items ())])
621
+
622
+ r , h = self ._result (self ._execute_request (qs ))
623
+ self ._img_diff_error (r , h , "WMS_GetLegendGraphic_ScaleSymbol_Scaled_02" , max_size_diff = QSize (15 , 15 ))
624
+
625
+ def test_wms_GetLegendGraphic_ScaleSymbol_Max (self ):
626
+ # 1:100000 max
627
+ qs = "?" + "&" .join (["%s=%s" % i for i in list ({
628
+ "MAP" : self .testdata_path + 'test_project_scaledsymbols.qgs' ,
629
+ "SERVICE" : "WMS" ,
630
+ "REQUEST" : "GetLegendGraphic" ,
631
+ "LAYER" : "testlayer" ,
632
+ "FORMAT" : "image/png" ,
633
+ "HEIGHT" : "550" ,
634
+ "WIDTH" : "850" ,
635
+ "BBOX" : "44.8,8.0,45.0,8.4" ,
636
+ "CRS" : "EPSG:4326"
637
+ }.items ())])
638
+
639
+ r , h = self ._result (self ._execute_request (qs ))
640
+ self ._img_diff_error (r , h , "WMS_GetLegendGraphic_ScaleSymbol_Max" , max_size_diff = QSize (15 , 15 ))
641
+
642
+ # 1:1000000 max
643
+ qs = "?" + "&" .join (["%s=%s" % i for i in list ({
644
+ "MAP" : self .testdata_path + 'test_project_scaledsymbols.qgs' ,
645
+ "SERVICE" : "WMS" ,
646
+ "REQUEST" : "GetLegendGraphic" ,
647
+ "LAYER" : "testlayer" ,
648
+ "FORMAT" : "image/png" ,
649
+ "HEIGHT" : "550" ,
650
+ "WIDTH" : "850" ,
651
+ "BBOX" : "43.6,6.2,46.2,10.2" ,
652
+ "CRS" : "EPSG:4326"
653
+ }.items ())])
654
+
655
+ r , h = self ._result (self ._execute_request (qs ))
656
+ self ._img_diff_error (r , h , "WMS_GetLegendGraphic_ScaleSymbol_Max" , max_size_diff = QSize (15 , 15 ))
657
+
558
658
559
659
if __name__ == '__main__' :
560
660
unittest .main ()
0 commit comments