Skip to content
Permalink
Browse files

Followup 956c155: fix python errors in PAL labeling tests

  • Loading branch information
nyalldawson committed Feb 1, 2015
1 parent 9ba8b29 commit 6e9468811e70d5efcf858d40f78197bfd981896d
Showing with 4 additions and 5 deletions.
  1. +4 −5 tests/src/python/test_qgspallabeling_base.py
@@ -155,9 +155,8 @@ def removeMapLayer(cls, layer):
lyr_id = layer.id()
cls._MapRegistry.removeMapLayer(lyr_id)
ms_layers = cls._MapSettings.layers()
""":type: QStringList"""
if ms_layers.contains(lyr_id):
ms_layers.removeAt(ms_layers.indexOf(lyr_id))
if lyr_id in ms_layers:
ms_layers.remove(lyr_id)
cls._MapSettings.setLayers(ms_layers)

@classmethod
@@ -390,15 +389,15 @@ def tearDown(self):

def test_default_pal_disabled(self):
# Verify PAL labeling is disabled for layer by default
palset = self.layer.customProperty('labeling', '').toString()
palset = self.layer.customProperty('labeling', '')
msg = '\nExpected: Empty string\nGot: {0}'.format(palset)
self.assertEqual(palset, '', msg)

def test_settings_enable_pal(self):
# Verify default PAL settings enable PAL labeling for layer
lyr = QgsPalLayerSettings()
lyr.writeToLayer(self.layer)
palset = self.layer.customProperty('labeling', '').toString()
palset = self.layer.customProperty('labeling', '')
msg = '\nExpected: Empty string\nGot: {0}'.format(palset)
self.assertEqual(palset, 'pal', msg)

0 comments on commit 6e94688

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