Skip to content

Commit 44143c1

Browse files
committed
Restore a disabled test for Qt5 which works OK now
1 parent fb5caa7 commit 44143c1

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

tests/src/python/test_qgslayoutpicture.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import socketserver
1919
import threading
2020
import http.server
21-
from qgis.PyQt.QtCore import QRectF
21+
from qgis.PyQt.QtCore import QRectF, QDir
2222

2323
from qgis.core import (QgsLayoutItemPicture,
2424
QgsLayout,
@@ -70,24 +70,33 @@ def __init__(self, methodName):
7070
self.picture.setFrameEnabled(True)
7171
self.layout.addLayoutItem(self.picture)
7272

73+
def setUp(self):
74+
self.report = "<h1>Python QgsLayoutItemPicture Tests</h1>\n"
75+
76+
def tearDown(self):
77+
report_file_path = "%s/qgistest.html" % QDir.tempPath()
78+
with open(report_file_path, 'a') as report_file:
79+
report_file.write(self.report)
80+
7381
def testResizeZoom(self):
7482
"""Test picture resize zoom mode."""
7583
self.picture.setResizeMode(QgsLayoutItemPicture.Zoom)
7684

7785
checker = QgsLayoutChecker('composerpicture_resize_zoom', self.layout)
7886
checker.setControlPathPrefix("composer_picture")
7987
testResult, message = checker.testLayout()
88+
self.report += checker.report()
8089

8190
assert testResult, message
8291

83-
@unittest.skip('test is broken for qt5/python3 - feature works')
8492
def testRemoteImage(self):
8593
"""Test fetching remote picture."""
8694
self.picture.setPicturePath('http://localhost:' + str(TestQgsLayoutPicture.port) + '/qgis_local_server/logo.png')
8795

88-
checker = QgsLayoutChecker('picture_remote', self.layout)
96+
checker = QgsLayoutChecker('composerpicture_remote', self.layout)
8997
checker.setControlPathPrefix("composer_picture")
9098
testResult, message = checker.testLayout()
99+
self.report += checker.report()
91100

92101
self.picture.setPicturePath(self.pngImage)
93102
assert testResult, message

0 commit comments

Comments
 (0)