Skip to content
Permalink
Browse files

Add a test for rule based labeling without setting

  • Loading branch information
Hugo Mercier
Hugo Mercier committed Jun 29, 2018
1 parent 831d1b1 commit 4dbae688f208c64705aa16bc4ee5611213414525
Showing with 8 additions and 1 deletion.
  1. +8 −1 tests/src/python/test_qgssymbollayer_createsld.py
@@ -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()
layer.labeling().rootRule().appendChild(QgsRuleBasedLabeling.Rule(None))
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 4dbae68

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