Skip to content

Commit

Permalink
Tweak tolerances for CanvasPoint and ComposerPdfPoint PAL tests
Browse files Browse the repository at this point in the history
.. to succeed on Ubuntu 14.04.1 LTS
  • Loading branch information
Sandro Santilli committed Dec 12, 2014
1 parent 5a25461 commit bd4087b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/src/python/test_qgspallabeling_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def checkTest(self, **kwargs):

def test_default_label(self):
# Default label placement, with text size in points
self._Mismatches['TestCanvasPoint'] = 776;
self._ColorTols['TestComposerPdfPoint'] = 2;
self.checkTest()

def test_text_size_map_unit(self):
Expand All @@ -65,15 +67,21 @@ def test_text_size_map_unit(self):
font = QFont(self._TestFont)
font.setPointSizeF(460)
self.lyr.textFont = font
self._Mismatches['TestCanvasPoint'] = 776;
self._ColorTols['TestComposerPdfPoint'] = 2;
self.checkTest()

def test_text_color(self):
self._Mismatches['TestCanvasPoint'] = 774;
self._ColorTols['TestComposerPdfPoint'] = 2;
# Label color change
self.lyr.textColor = Qt.blue
self.checkTest()

def test_background_rect(self):
self.lyr.shapeDraw = True
self._Mismatches['TestCanvasPoint'] = 776;
self._ColorTols['TestComposerPdfPoint'] = 1;
self.checkTest()

def test_background_rect_w_offset(self):
Expand All @@ -89,6 +97,9 @@ def test_background_rect_w_offset(self):
self.lyr.shapeDraw = True
self.lyr.shapeOffsetUnits = QgsPalLayerSettings.MapUnits
self.lyr.shapeOffset = QPointF(-2900.0, -450.0)

self._Mismatches['TestCanvasPoint'] = 774;
self._ColorTols['TestComposerPdfPoint'] = 2;
self.checkTest()

def test_background_svg(self):
Expand All @@ -107,6 +118,8 @@ def test_background_svg(self):
self.lyr.shapeSizeType = QgsPalLayerSettings.SizeBuffer
self.lyr.shapeSize = QPointF(100.0, 0.0)
self._Mismatches['TestComposerPdfVsComposerPoint'] = 580
self._Mismatches['TestCanvasPoint'] = 776;
self._ColorTols['TestComposerPdfPoint'] = 2;
self.checkTest()

def test_background_svg_w_offset(self):
Expand All @@ -128,6 +141,8 @@ def test_background_svg_w_offset(self):
self.lyr.shapeOffsetUnits = QgsPalLayerSettings.MapUnits
self.lyr.shapeOffset = QPointF(-2850.0, 500.0)
self._Mismatches['TestComposerPdfVsComposerPoint'] = 760
self._Mismatches['TestCanvasPoint'] = 776;
self._ColorTols['TestComposerPdfPoint'] = 2;
self.checkTest()

def test_partials_labels_enabled(self):
Expand All @@ -138,6 +153,8 @@ def test_partials_labels_enabled(self):
# Enable partials labels
self._Pal.setShowingPartialsLabels(True)
self._Pal.saveEngineSettings()
self._Mismatches['TestCanvasPoint'] = 779;
self._ColorTols['TestComposerPdfPoint'] = 2;
self.checkTest()

def test_partials_labels_disabled(self):
Expand Down

0 comments on commit bd4087b

Please sign in to comment.