Skip to content
Permalink
Browse files

Unit tests for ShowingPartialsLabels reorganized

  • Loading branch information
yellow-sky committed Sep 26, 2013
1 parent 9e4fdcf commit 3e382dac775094c372dedc69835a883899f62403
Showing with 18 additions and 6 deletions.
  1. +18 −0 tests/src/python/test_qgspallabeling_base.py
  2. +0 −6 tests/src/python/test_qgspallabeling_tests.py
@@ -299,6 +299,24 @@ def test_write_read_settings(self):

msg = '\nLayer settings read not same as settings written'
self.assertDictEqual(lyr1dict, lyr2dict, msg)

def test_default_partials_labels_enabled(self):
# Verify ShowingPartialsLabels is enabled for PAL by default
pal = QgsPalLabeling()
self.assertTrue(pal.isShowingPartialsLabels())

def test_partials_labels_activate(self):
pal = QgsPalLabeling()
# Enable partials labels
pal.setShowingPartialsLabels(True)
self.assertTrue(pal.isShowingPartialsLabels())

def test_partials_labels_deactivate(self):
pal = QgsPalLabeling()
# Disable partials labels
pal.setShowingPartialsLabels(False)
self.assertFalse(pal.isShowingPartialsLabels())



def runSuite(module, tests):
@@ -51,10 +51,6 @@ def test_text_color(self):
# Label color change
self.lyr.textColor = Qt.blue
self.checkTest()

def test_partials_labels_def_setting_value(self):
# by default: enabled
self.assertTrue(self._PalEngine.isShowingPartialsLabels())

def test_partials_labels_enabled(self):
# Set Big font size
@@ -63,7 +59,6 @@ def test_partials_labels_enabled(self):
self.lyr.textFont = font
# Enable partials labels
self._PalEngine.setShowingPartialsLabels(True)
self.assertTrue(self._PalEngine.isShowingPartialsLabels())
# Check
self.checkTest()

@@ -74,7 +69,6 @@ def test_partials_labels_disabled(self):
self.lyr.textFont = font
# Disable partials labels
self._PalEngine.setShowingPartialsLabels(False)
self.assertFalse(self._PalEngine.isShowingPartialsLabels())
# Check
self.checkTest()

0 comments on commit 3e382da

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