Skip to content
Permalink
Browse files

Rebuild labeling tests control images with smaller size (420 x 280)

  • Loading branch information
dakcarto committed Mar 25, 2014
1 parent 90f012d commit db4401fe0097e3e72f81829f50eb331cd5998d33
Showing with 7 additions and 11 deletions.
  1. +2 −2 tests/src/python/test_qgspallabeling_base.py
  2. +2 −1 tests/src/python/test_qgspallabeling_composer.py
  3. +1 −1 tests/src/python/test_qgspallabeling_server.py
  4. +2 −7 tests/src/python/test_qgspallabeling_tests.py
  5. BIN tests/testdata/control_images/expected_pal_canvas/sp_background_rect/sp_background_rect.png
  6. BIN ...ta/control_images/expected_pal_canvas/sp_background_rect_w_offset/sp_background_rect_w_offset.png
  7. BIN tests/testdata/control_images/expected_pal_canvas/sp_background_svg/sp_background_svg.png
  8. BIN ...data/control_images/expected_pal_canvas/sp_background_svg_w_offset/sp_background_svg_w_offset.png
  9. BIN tests/testdata/control_images/expected_pal_canvas/sp_default_label/sp_default_label.png
  10. BIN ...ta/control_images/expected_pal_canvas/sp_partials_labels_disabled/sp_partials_labels_disabled.png
  11. BIN ...data/control_images/expected_pal_canvas/sp_partials_labels_enabled/sp_partials_labels_enabled.png
  12. BIN tests/testdata/control_images/expected_pal_canvas/sp_text_color/sp_text_color.png
  13. BIN tests/testdata/control_images/expected_pal_canvas/sp_text_size_map_unit/sp_text_size_map_unit.png
  14. BIN ...s/testdata/control_images/expected_pal_composer/sp_img_background_rect/sp_img_background_rect.png
  15. BIN ..._images/expected_pal_composer/sp_img_background_rect_w_offset/sp_img_background_rect_w_offset.png
  16. BIN tests/testdata/control_images/expected_pal_composer/sp_img_background_svg/sp_img_background_svg.png
  17. BIN ...ol_images/expected_pal_composer/sp_img_background_svg_w_offset/sp_img_background_svg_w_offset.png
  18. BIN tests/testdata/control_images/expected_pal_composer/sp_img_default_label/sp_img_default_label.png
  19. BIN ..._images/expected_pal_composer/sp_img_partials_labels_disabled/sp_img_partials_labels_disabled.png
  20. BIN ...ol_images/expected_pal_composer/sp_img_partials_labels_enabled/sp_img_partials_labels_enabled.png
  21. BIN tests/testdata/control_images/expected_pal_composer/sp_img_text_color/sp_img_text_color.png
  22. BIN ...data/control_images/expected_pal_composer/sp_img_text_size_map_unit/sp_img_text_size_map_unit.png
  23. BIN ...s/testdata/control_images/expected_pal_composer/sp_svg_background_rect/sp_svg_background_rect.png
  24. BIN ..._images/expected_pal_composer/sp_svg_background_rect_w_offset/sp_svg_background_rect_w_offset.png
  25. BIN tests/testdata/control_images/expected_pal_composer/sp_svg_background_svg/sp_svg_background_svg.png
  26. BIN ...ol_images/expected_pal_composer/sp_svg_background_svg_w_offset/sp_svg_background_svg_w_offset.png
  27. BIN tests/testdata/control_images/expected_pal_composer/sp_svg_default_label/sp_svg_default_label.png
  28. BIN ..._images/expected_pal_composer/sp_svg_partials_labels_disabled/sp_svg_partials_labels_disabled.png
  29. BIN ...ol_images/expected_pal_composer/sp_svg_partials_labels_enabled/sp_svg_partials_labels_enabled.png
  30. BIN tests/testdata/control_images/expected_pal_composer/sp_svg_text_color/sp_svg_text_color.png
  31. BIN ...data/control_images/expected_pal_composer/sp_svg_text_size_map_unit/sp_svg_text_size_map_unit.png
  32. BIN tests/testdata/control_images/expected_pal_server/sp_background_rect/sp_background_rect.png
  33. BIN ...ta/control_images/expected_pal_server/sp_background_rect_w_offset/sp_background_rect_w_offset.png
  34. BIN tests/testdata/control_images/expected_pal_server/sp_background_svg/sp_background_svg.png
  35. BIN ...data/control_images/expected_pal_server/sp_background_svg_w_offset/sp_background_svg_w_offset.png
  36. BIN tests/testdata/control_images/expected_pal_server/sp_default_label/sp_default_label.png
  37. BIN ...ta/control_images/expected_pal_server/sp_partials_labels_disabled/sp_partials_labels_disabled.png
  38. BIN ...data/control_images/expected_pal_server/sp_partials_labels_enabled/sp_partials_labels_enabled.png
  39. BIN tests/testdata/control_images/expected_pal_server/sp_text_color/sp_text_color.png
  40. BIN tests/testdata/control_images/expected_pal_server/sp_text_size_map_unit/sp_text_size_map_unit.png
@@ -208,7 +208,7 @@ def getBaseMapSettings(cls):
# default for labeling test data: WGS 84 / UTM zone 13N
crs.createFromSrid(32613)
ms.setBackgroundColor(QColor(152, 219, 249))
ms.setOutputSize(QSize(600, 400))
ms.setOutputSize(QSize(420, 280))
ms.setOutputDpi(72)
ms.setFlag(QgsMapSettings.Antialiasing)
ms.setDestinationCrs(crs)
@@ -258,7 +258,7 @@ def defaultLayerSettings(self):
lyr.enabled = True
lyr.fieldName = 'text' # default in test data sources
font = self.getTestFont()
font.setPointSize(48)
font.setPointSize(32)
lyr.textFont = font
lyr.textNamedStyle = 'Roman'
return lyr
@@ -264,7 +264,7 @@ def checkTest(self, **kwargs):
mismatch = 0
if 'PAL_NO_MISMATCH' not in os.environ:
# some mismatch expected
mismatch = self._Mismatch if self._Mismatch else 200
mismatch = self._Mismatch if self._Mismatch else 20
if self._TestGroup in self._Mismatches:
mismatch = self._Mismatches[self._TestGroup]
colortol = 0
@@ -320,6 +320,7 @@ def setUp(self):
super(TestComposerSvgVsComposerPoint, self).setUp()
self._TestKind = OutputKind.Svg
self.configTest('pal_composer', 'sp_img')
self._Mismatch = 350


if __name__ == '__main__':
@@ -167,7 +167,7 @@ def checkTest(self, **kwargs):
mismatch = 0
if 'PAL_NO_MISMATCH' not in os.environ:
# some mismatch expected
mismatch = self._Mismatch if self._Mismatch else 50
mismatch = self._Mismatch if self._Mismatch else 20
if self._TestGroup in self._Mismatches:
mismatch = self._Mismatches[self._TestGroup]
colortol = 0
@@ -56,7 +56,6 @@ def checkTest(self, **kwargs):

def test_default_label(self):
# Default label placement, with text size in points
self._Mismatches['TestComposerSvgVsComposerPoint'] = 500
self.checkTest()

def test_text_size_map_unit(self):
@@ -70,12 +69,10 @@ def test_text_size_map_unit(self):
def test_text_color(self):
# Label color change
self.lyr.textColor = Qt.blue
self._Mismatches['TestComposerSvgVsComposerPoint'] = 500
self.checkTest()

def test_background_rect(self):
self.lyr.shapeDraw = True
self._Mismatches['TestComposerSvgVsComposerPoint'] = 1100
self.checkTest()

def test_background_rect_w_offset(self):
@@ -91,7 +88,6 @@ 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['TestComposerSvgVsComposerPoint'] = 750
self.checkTest()

def test_background_svg(self):
@@ -134,18 +130,17 @@ def test_background_svg_w_offset(self):
def test_partials_labels_enabled(self):
# Set Big font size
font = QFont(self._TestFont)
font.setPointSizeF(120)
font.setPointSizeF(84)
self.lyr.textFont = font
# Enable partials labels
self._Pal.setShowingPartialsLabels(True)
self._Pal.saveEngineSettings()
self._Mismatches['TestComposerSvgVsComposerPoint'] = 600
self.checkTest()

def test_partials_labels_disabled(self):
# Set Big font size
font = QFont(self._TestFont)
font.setPointSizeF(120)
font.setPointSizeF(84)
self.lyr.textFont = font
# Disable partials labels
self._Pal.setShowingPartialsLabels(False)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

0 comments on commit db4401f

Please sign in to comment.
You can’t perform that action at this time.