Skip to content

Commit 10f2ac9

Browse files
committedFeb 21, 2014
Fix partial labels unit tests and generate new control images
1 parent 1d91641 commit 10f2ac9

File tree

8 files changed

+13
-25
lines changed

8 files changed

+13
-25
lines changed
 

‎tests/src/python/test_qgspallabeling_tests.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,21 @@
1919
from PyQt4.QtCore import *
2020
from PyQt4.QtGui import *
2121

22-
from qgis.core import (
23-
QgsPalLayerSettings,
24-
)
22+
from qgis.core import *
2523

2624

2725
class TestPointBase(object):
2826

2927
def __init__(self):
3028
"""Dummy assignments, intended to be overriden in subclasses"""
3129
self.lyr = QgsPalLayerSettings()
30+
""":type: QgsPalLayerSettings"""
3231
self._TestFont = QApplication.font() # will become a standard test font
32+
self.params = dict()
33+
self._Pal = None
34+
""":type: QgsPalLabeling"""
35+
self._Canvas = None
36+
""":type: QgsMapCanvas"""
3337

3438
def checkTest(self, **kwargs):
3539
"""Intended to be overriden in subclasses"""
@@ -55,20 +59,22 @@ def test_text_color(self):
5559
def test_partials_labels_enabled(self):
5660
# Set Big font size
5761
font = QFont(self._TestFont)
58-
font.setPointSizeF(90)
62+
font.setPointSizeF(120)
5963
self.lyr.textFont = font
6064
# Enable partials labels
61-
self._PalEngine.setShowingPartialsLabels(True)
65+
self._Pal.setShowingPartialsLabels(True)
66+
self._Pal.saveEngineSettings()
6267
# Check
6368
self.checkTest()
6469

6570
def test_partials_labels_disabled(self):
6671
# Set Big font size
6772
font = QFont(self._TestFont)
68-
font.setPointSizeF(90)
73+
font.setPointSizeF(120)
6974
self.lyr.textFont = font
7075
# Disable partials labels
71-
self._PalEngine.setShowingPartialsLabels(False)
76+
self._Pal.setShowingPartialsLabels(False)
77+
self._Pal.saveEngineSettings()
7278
# Check
7379
self.checkTest()
7480

‎tests/testdata/control_images/expected_pal_canvas/sp_default_label/sp_default_label.PNGw

Lines changed: 0 additions & 6 deletions
This file was deleted.
-703 KB

Error rendering embedded code

Invalid image source.

-696 KB

Error rendering embedded code

Invalid image source.

‎tests/testdata/control_images/expected_pal_canvas/sp_text_color/sp_text_color.PNGw

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎tests/testdata/control_images/expected_pal_canvas/sp_text_size_map_unit/sp_text_size_map_unit.PNGw

Lines changed: 0 additions & 6 deletions
This file was deleted.
1.78 KB

Error rendering embedded code

Invalid image source.

8.86 KB

Error rendering embedded code

Invalid image source.

0 commit comments

Comments
 (0)
Please sign in to comment.