@@ -40,9 +40,13 @@ def __init__(self):
40
40
""":type: QgsPalLabeling"""
41
41
self ._Canvas = None
42
42
""":type: QgsMapCanvas"""
43
+ # custom mismatches per group/test (should not mask needed anomaly)
44
+ # e.g. self._Mismatches['TestClassName'] = 300
45
+ self ._Mismatches = dict ()
43
46
44
47
def test_default_label (self ):
45
48
# Default label placement, with text size in points
49
+ self ._Mismatches ['TestComposerImageVsCanvasPoint' ] = 2034
46
50
self .checkTest ()
47
51
48
52
def test_text_size_map_unit (self ):
@@ -51,15 +55,18 @@ def test_text_size_map_unit(self):
51
55
font = QFont (self ._TestFont )
52
56
font .setPointSizeF (460 )
53
57
self .lyr .textFont = font
58
+ self ._Mismatches ['TestComposerImageVsCanvasPoint' ] = 1877
54
59
self .checkTest ()
55
60
56
61
def test_text_color (self ):
57
62
# Label color change
58
63
self .lyr .textColor = Qt .blue
64
+ self ._Mismatches ['TestComposerImageVsCanvasPoint' ] = 2034
59
65
self .checkTest ()
60
66
61
67
def test_background_rect (self ):
62
68
self .lyr .shapeDraw = True
69
+ self ._Mismatches ['TestComposerImageVsCanvasPoint' ] = 2751
63
70
self .checkTest ()
64
71
65
72
def test_background_rect_w_offset (self ):
@@ -75,11 +82,11 @@ def test_background_rect_w_offset(self):
75
82
self .lyr .shapeDraw = True
76
83
self .lyr .shapeOffsetUnits = QgsPalLayerSettings .MapUnits
77
84
self .lyr .shapeOffset = QPointF (- 2900.0 , - 450.0 )
85
+ self ._Mismatches ['TestComposerImageVsCanvasPoint' ] = 2530
78
86
self .checkTest ()
79
87
80
88
def test_background_svg (self ):
81
89
# Label SVG background
82
- # NOTE: this has higher _CheckMismatch (3600) in ComposerVsCanvasPoint
83
90
self .lyr .fontSizeInMapUnits = True
84
91
font = QFont (self ._TestFont )
85
92
font .setPointSizeF (460 )
@@ -93,11 +100,11 @@ def test_background_svg(self):
93
100
self .lyr .shapeSizeUnits = QgsPalLayerSettings .MapUnits
94
101
self .lyr .shapeSizeType = QgsPalLayerSettings .SizeBuffer
95
102
self .lyr .shapeSize = QPointF (100.0 , 0.0 )
103
+ self ._Mismatches ['TestComposerImageVsCanvasPoint' ] = 2882
96
104
self .checkTest ()
97
105
98
106
def test_background_svg_w_offset (self ):
99
107
# Label SVG background
100
- # NOTE: this has higher _CheckMismatch (3600) in ComposerVsCanvasPoint
101
108
self .lyr .fontSizeInMapUnits = True
102
109
font = QFont (self ._TestFont )
103
110
font .setPointSizeF (460 )
@@ -114,6 +121,7 @@ def test_background_svg_w_offset(self):
114
121
115
122
self .lyr .shapeOffsetUnits = QgsPalLayerSettings .MapUnits
116
123
self .lyr .shapeOffset = QPointF (- 2850.0 , 500.0 )
124
+ self ._Mismatches ['TestComposerImageVsCanvasPoint' ] = 2901
117
125
self .checkTest ()
118
126
119
127
def test_partials_labels_enabled (self ):
@@ -124,7 +132,7 @@ def test_partials_labels_enabled(self):
124
132
# Enable partials labels
125
133
self ._Pal .setShowingPartialsLabels (True )
126
134
self ._Pal .saveEngineSettings ()
127
- # Check
135
+ self . _Mismatches [ 'TestComposerImageVsCanvasPoint' ] = 2250
128
136
self .checkTest ()
129
137
130
138
def test_partials_labels_disabled (self ):
@@ -135,7 +143,6 @@ def test_partials_labels_disabled(self):
135
143
# Disable partials labels
136
144
self ._Pal .setShowingPartialsLabels (False )
137
145
self ._Pal .saveEngineSettings ()
138
- # Check
139
146
self .checkTest ()
140
147
141
148
@@ -145,29 +152,26 @@ def suiteTests():
145
152
Use to define which tests are run when PAL_SUITE is set.
146
153
Use sp_vs_suite comparison of server and composer outputs to canvas
147
154
"""
155
+ sp_suite = [
156
+ # 'test_default_label',
157
+ # 'test_text_size_map_unit',
158
+ # 'test_text_color',
159
+ # 'test_background_rect',
160
+ # 'test_background_rect_w_offset',
161
+ # 'test_background_svg',
162
+ # 'test_background_svg_w_offset',
163
+ # 'test_partials_labels_enabled',
164
+ # 'test_partials_labels_disabled',
165
+ ]
166
+ sp_vs_suite = [
167
+ #'test_something_specific',
168
+ ]
169
+ # extended separately for finer control of PAL_SUITE (comment-out undesired)
170
+ sp_vs_suite .extend (sp_suite )
171
+
148
172
return {
149
- 'sp_suite' : [
150
- # 'test_default_label',
151
- # 'test_text_size_map_unit',
152
- # 'test_text_color',
153
- # 'test_background_rect',
154
- # 'test_background_rect_w_offset',
155
- # 'test_background_svg',
156
- # 'test_background_svg_w_offset',
157
- # 'test_partials_labels_enabled',
158
- # 'test_partials_labels_disabled',
159
- ],
160
- 'sp_vs_suite' : [
161
- # 'test_default_label',
162
- # 'test_text_size_map_unit',
163
- # 'test_text_color',
164
- # 'test_background_rect',
165
- # 'test_background_rect_w_offset',
166
- # 'test_background_svg',
167
- # 'test_background_svg_w_offset',
168
- # 'test_partials_labels_enabled',
169
- # 'test_partials_labels_disabled',
170
- ]
173
+ 'sp_suite' : sp_suite ,
174
+ 'sp_vs_suite' : sp_vs_suite
171
175
}
172
176
173
177
0 commit comments