Skip to content

Commit

Permalink
Followup 956c155: fix python errors in PAL labeling tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 1, 2015
1 parent 9ba8b29 commit 6e94688
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/src/python/test_qgspallabeling_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 6e94688

Please sign in to comment.