Fix partial labels unit tests and generate new control images

This commit is contained in:
Larry Shaffer 2014-02-20 21:22:41 -07:00
parent 1d91641769
commit 10f2ac92ac
8 changed files with 13 additions and 25 deletions

View File

@ -19,9 +19,7 @@ import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import (
QgsPalLayerSettings,
)
from qgis.core import *
class TestPointBase(object):
@ -29,7 +27,13 @@ class TestPointBase(object):
def __init__(self):
"""Dummy assignments, intended to be overriden in subclasses"""
self.lyr = QgsPalLayerSettings()
""":type: QgsPalLayerSettings"""
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):
"""Intended to be overriden in subclasses"""
@ -55,20 +59,22 @@ class TestPointBase(object):
def test_partials_labels_enabled(self):
# Set Big font size
font = QFont(self._TestFont)
font.setPointSizeF(90)
font.setPointSizeF(120)
self.lyr.textFont = font
# Enable partials labels
self._PalEngine.setShowingPartialsLabels(True)
self._Pal.setShowingPartialsLabels(True)
self._Pal.saveEngineSettings()
# Check
self.checkTest()
def test_partials_labels_disabled(self):
# Set Big font size
font = QFont(self._TestFont)
font.setPointSizeF(90)
font.setPointSizeF(120)
self.lyr.textFont = font
# Disable partials labels
self._PalEngine.setShowingPartialsLabels(False)
self._Pal.setShowingPartialsLabels(False)
self._Pal.saveEngineSettings()
# Check
self.checkTest()

View File

@ -1,6 +0,0 @@
10
0
0
-10
606515
4827125

Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -1,6 +0,0 @@
10
0
0
-10
606515
4827125

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB