Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update text renderer tests
  • Loading branch information
nyalldawson committed Apr 28, 2017
1 parent 455f973 commit 38414b3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 55 deletions.
9 changes: 8 additions & 1 deletion tests/src/python/test_qgstextformatwidget.py
Expand Up @@ -19,7 +19,8 @@
QgsTextShadowSettings,
QgsTextFormat,
QgsUnitTypes,
QgsMapUnitScale)
QgsMapUnitScale,
QgsBlurEffect)
from qgis.gui import (QgsTextFormatWidget, QgsTextFormatDialog)
from qgis.PyQt.QtGui import (QColor, QPainter)
from qgis.PyQt.QtCore import (Qt, QSizeF, QPointF)
Expand All @@ -42,6 +43,7 @@ def createBufferSettings(self):
s.setOpacity(0.5)
s.setJoinStyle(Qt.RoundJoin)
s.setBlendMode(QPainter.CompositionMode_Difference)
s.setPaintEffect(QgsBlurEffect.create({'blur_level': '10', 'enabled': '1'}))
return s

def checkBufferSettings(self, s):
Expand All @@ -55,6 +57,8 @@ def checkBufferSettings(self, s):
self.assertEqual(s.opacity(), 0.5)
self.assertEqual(s.joinStyle(), Qt.RoundJoin)
self.assertEqual(s.blendMode(), QPainter.CompositionMode_Difference)
self.assertTrue(s.paintEffect())
self.assertEqual(s.paintEffect().blurLevel(), 10)

def createBackgroundSettings(self):
s = QgsTextBackgroundSettings()
Expand All @@ -81,6 +85,7 @@ def createBackgroundSettings(self):
s.setStrokeWidth(7)
s.setStrokeWidthUnit(QgsUnitTypes.RenderMapUnits)
s.setStrokeWidthMapUnitScale(QgsMapUnitScale(QgsMapUnitScale(25, 26)))
s.setPaintEffect(QgsBlurEffect.create({'blur_level': '6', 'enabled': '1'}))
return s

def checkBackgroundSettings(self, s):
Expand Down Expand Up @@ -108,6 +113,8 @@ def checkBackgroundSettings(self, s):
self.assertEqual(s.strokeWidth(), 7)
self.assertEqual(s.strokeWidthUnit(), QgsUnitTypes.RenderMapUnits)
self.assertEqual(s.strokeWidthMapUnitScale(), QgsMapUnitScale(25, 26))
self.assertTrue(s.paintEffect())
self.assertEqual(s.paintEffect().blurLevel(), 6)

def createShadowSettings(self):
s = QgsTextShadowSettings()
Expand Down

0 comments on commit 38414b3

Please sign in to comment.