Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Unit tests for ShowingPartialsLabels reorganized
  • Loading branch information
yellow-sky committed Sep 26, 2013
1 parent 9e4fdcf commit 3e382da
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
18 changes: 18 additions & 0 deletions tests/src/python/test_qgspallabeling_base.py
Expand Up @@ -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):
Expand Down
6 changes: 0 additions & 6 deletions tests/src/python/test_qgspallabeling_tests.py
Expand Up @@ -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
Expand All @@ -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()

Expand All @@ -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()

Expand Down

0 comments on commit 3e382da

Please sign in to comment.