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