Skip to content
Permalink
Browse files
Fix text renderer test
  • Loading branch information
wonder-sk committed May 13, 2017
1 parent c882f88 commit bbb13f4338a7675c35f44c42ce48723b99e7a3df
Showing with 8 additions and 7 deletions.
  1. +8 −7 tests/src/python/test_qgstextrenderer.py
@@ -24,6 +24,7 @@
QgsVectorLayer,
QgsTextRenderer,
QgsMapSettings,
QgsReadWriteContext,
QgsRenderContext,
QgsRectangle,
QgsRenderChecker,
@@ -202,11 +203,11 @@ def testBackgroundReadWriteXml(self):
"""test saving and restoring state of a background to xml"""
doc = QDomDocument("testdoc")
s = self.createBackgroundSettings()
elem = s.writeXml(doc)
elem = s.writeXml(doc, QgsReadWriteContext())
parent = doc.createElement("settings")
parent.appendChild(elem)
t = QgsTextBackgroundSettings()
t.readXml(parent)
t.readXml(parent, QgsReadWriteContext())
self.checkBackgroundSettings(t)

def createShadowSettings(self):
@@ -352,11 +353,11 @@ def testFormatReadWriteXml(self):
"""test saving and restoring state of a shadow to xml"""
doc = QDomDocument("testdoc")
s = self.createFormatSettings()
elem = s.writeXml(doc)
elem = s.writeXml(doc, QgsReadWriteContext())
parent = doc.createElement("settings")
parent.appendChild(elem)
t = QgsTextFormat()
t.readXml(parent)
t.readXml(parent, QgsReadWriteContext())
self.checkTextFormat(t)

def containsAdvancedEffects(self):
@@ -404,17 +405,17 @@ def testFontFoundFromLayer(self):
def testFontFoundFromXml(self):
doc = QDomDocument("testdoc")
f = QgsTextFormat()
elem = f.writeXml(doc)
elem = f.writeXml(doc, QgsReadWriteContext())
elem.setAttribute('fontFamily', 'asdfasdfsadf')
parent = doc.createElement("parent")
parent.appendChild(elem)

f.readXml(parent)
f.readXml(parent, QgsReadWriteContext())
self.assertFalse(f.fontFound())

font = getTestFont()
elem.setAttribute('fontFamily', font.family())
f.readXml(parent)
f.readXml(parent, QgsReadWriteContext())
self.assertTrue(f.fontFound())

def imageCheck(self, name, reference_image, image):

0 comments on commit bbb13f4

Please sign in to comment.