Skip to content

Commit ab5e0e2

Browse files
committedNov 14, 2014
Fix PalLabelingComposer test
Switch to QgsMultiRenderChecker and add control images for Ubuntu precise where required.
1 parent 5893289 commit ab5e0e2

File tree

82 files changed

+11
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+11
-11
lines changed
 

‎tests/src/python/test_qgspallabeling_base.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
QgsPalLayerSettings,
3939
QgsProviderRegistry,
4040
QgsVectorLayer,
41-
QgsRenderChecker
41+
QgsMultiRenderChecker
4242
)
4343

4444
from utilities import (
@@ -345,23 +345,23 @@ def renderCheck(self, mismatch=0, colortol=0, imgpath='', grpprefix=''):
345345
"""
346346
if not grpprefix:
347347
grpprefix = self._TestGroupPrefix
348-
ctl_path = self.controlImagePath(grpprefix)
349-
if not os.path.exists(ctl_path):
350-
raise OSError('Missing control image: {0}'.format(ctl_path))
351-
chk = QgsRenderChecker()
348+
chk = QgsMultiRenderChecker()
349+
352350
chk.setControlPathPrefix('expected_' + grpprefix)
351+
353352
chk.setControlName(self._Test)
354-
chk.setColorTolerance(colortol)
353+
354+
if imgpath:
355+
chk.setRenderedImage(imgpath)
356+
355357
ms = self._MapSettings # class settings
356358
if self._TestMapSettings is not None:
357359
ms = self._TestMapSettings # per test settings
358360
chk.setMapSettings(ms)
361+
362+
chk.setColorTolerance(colortol)
359363
# noinspection PyUnusedLocal
360-
res = False
361-
if imgpath:
362-
res = chk.compareImages(self._Test, mismatch, str(imgpath))
363-
else:
364-
res = chk.runTest(self._Test, mismatch)
364+
res = chk.runTest(self._Test, mismatch)
365365
if PALREPORT and not res: # don't report ok checks
366366
testname = self._TestGroup + ' . ' + self._Test
367367
PALREPORTS[testname] = str(chk.report().toLocal8Bit())

0 commit comments

Comments
 (0)
Please sign in to comment.