Skip to content
Browse files

Add a test for rule based labeling without setting

  • Loading branch information
Hugo Mercier
Hugo Mercier committed Jun 29, 2018
1 parent 0b066e5 commit c48388b5072015bf9c761fcd0c200195a0bcc49a
Showing with 8 additions and 1 deletion.
  1. +8 −1 tests/src/python/
@@ -32,7 +32,7 @@
QgsFontMarkerSymbolLayer, QgsEllipseSymbolLayer, QgsSimpleLineSymbolLayer,
QgsMarkerLineSymbolLayer, QgsMarkerSymbol, QgsSimpleFillSymbolLayer, QgsSVGFillSymbolLayer,
QgsLinePatternFillSymbolLayer, QgsPointPatternFillSymbolLayer, QgsVectorLayer, QgsVectorLayerSimpleLabeling,
QgsTextBufferSettings, QgsPalLayerSettings, QgsTextBackgroundSettings)
QgsTextBufferSettings, QgsPalLayerSettings, QgsTextBackgroundSettings, QgsRuleBasedLabeling)
from qgis.testing import start_app, unittest
from utilities import unitTestDataPath

@@ -1053,6 +1053,13 @@ def testRuleBasedLabels(self):
ltValue = gt.childNodes().item(1)
self.assertEqual("1000000", gtValue.toElement().text())

# check that adding a rule without settings does not segfault
xml1 = dom.toString()
dom, root = self.layerToSld(layer)
xml2 = dom.toString()
self.assertEqual(xml1, xml2)

def updateLinePlacementProperties(self, layer, linePlacement, distance, repeat, maxAngleInternal=25, maxAngleExternal=-25):
settings = layer.labeling().settings()
settings.placement = linePlacement

0 comments on commit c48388b

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