Skip to content

Commit

Permalink
Fix partial labels unit tests and generate new control images
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Feb 21, 2014
1 parent 1d91641 commit 10f2ac9
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 25 deletions.
20 changes: 13 additions & 7 deletions tests/src/python/test_qgspallabeling_tests.py
Expand Up @@ -19,17 +19,21 @@
from PyQt4.QtCore import * from PyQt4.QtCore import *
from PyQt4.QtGui import * from PyQt4.QtGui import *


from qgis.core import ( from qgis.core import *
QgsPalLayerSettings,
)




class TestPointBase(object): class TestPointBase(object):


def __init__(self): def __init__(self):
"""Dummy assignments, intended to be overriden in subclasses""" """Dummy assignments, intended to be overriden in subclasses"""
self.lyr = QgsPalLayerSettings() self.lyr = QgsPalLayerSettings()
""":type: QgsPalLayerSettings"""
self._TestFont = QApplication.font() # will become a standard test font self._TestFont = QApplication.font() # will become a standard test font
self.params = dict()
self._Pal = None
""":type: QgsPalLabeling"""
self._Canvas = None
""":type: QgsMapCanvas"""


def checkTest(self, **kwargs): def checkTest(self, **kwargs):
"""Intended to be overriden in subclasses""" """Intended to be overriden in subclasses"""
Expand All @@ -55,20 +59,22 @@ def test_text_color(self):
def test_partials_labels_enabled(self): def test_partials_labels_enabled(self):
# Set Big font size # Set Big font size
font = QFont(self._TestFont) font = QFont(self._TestFont)
font.setPointSizeF(90) font.setPointSizeF(120)
self.lyr.textFont = font self.lyr.textFont = font
# Enable partials labels # Enable partials labels
self._PalEngine.setShowingPartialsLabels(True) self._Pal.setShowingPartialsLabels(True)
self._Pal.saveEngineSettings()
# Check # Check
self.checkTest() self.checkTest()


def test_partials_labels_disabled(self): def test_partials_labels_disabled(self):
# Set Big font size # Set Big font size
font = QFont(self._TestFont) font = QFont(self._TestFont)
font.setPointSizeF(90) font.setPointSizeF(120)
self.lyr.textFont = font self.lyr.textFont = font
# Disable partials labels # Disable partials labels
self._PalEngine.setShowingPartialsLabels(False) self._Pal.setShowingPartialsLabels(False)
self._Pal.saveEngineSettings()
# Check # Check
self.checkTest() self.checkTest()


Expand Down

This file was deleted.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 10f2ac9

Please sign in to comment.