Skip to content
Browse files
Use a checkerboard background in svg cache tests
  • Loading branch information
nyalldawson committed Mar 29, 2018
1 parent c71347c commit 3f733e7061f95cf2a90705015d16561ae345f6b1
@@ -19,9 +19,9 @@
import threading
import http.server
from qgis.PyQt.QtCore import QDir
from qgis.PyQt.QtGui import QColor
from qgis.PyQt.QtGui import QColor, QImage, QPainter

from qgis.core import (QgsSvgCache, QgsRenderChecker, QgsApplication)
from qgis.core import (QgsSvgCache, QgsRenderChecker, QgsApplication, QgsMultiRenderChecker)
from qgis.testing import start_app, unittest
from utilities import unitTestDataPath

@@ -84,7 +84,14 @@ def imageCheck(self, name, reference_image, image): += "<h2>Render {}</h2>\n".format(name)
temp_dir = QDir.tempPath() + '/'
file_name = temp_dir + 'svg_' + name + ".png", "PNG")

output_image = QImage(image.size(), QImage.Format_RGB32)
painter = QPainter(output_image)
painter.drawImage(0, 0, image)
painter.end(), "PNG")
checker = QgsRenderChecker()
checker.setControlName("expected_" + reference_image)
Binary file not shown.
Binary file not shown.

0 comments on commit 3f733e7

Please sign in to comment.