Skip to content

Commit 4a800a1

Browse files
committed
Fix tests
1 parent 46f2ea1 commit 4a800a1

9 files changed

Lines changed: 3 additions & 40 deletions

File tree

‎scripts/parse_dash_results.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import struct
4545
import glob
4646

47-
dash_url = 'http://dash.orfeo-toolbox.org'
47+
dash_url = 'https://dash.orfeo-toolbox.org'
4848

4949

5050
def error(msg):
@@ -61,7 +61,7 @@ def colorDiff(c1, c2):
6161

6262

6363
def imageFromPath(path):
64-
if (path[:7] == 'http://' or path[:7] == 'file://'):
64+
if (path[:7] == 'https://' or path[:7] == 'file://'):
6565
# fetch remote image
6666
data = urllib.request.urlopen(path).read()
6767
image = QImage()
@@ -181,7 +181,7 @@ def load_images(self, control_image_path, rendered_image_path, mask_image_path):
181181
),
182182
self.rendered_image.width(
183183
),
184-
self.rendered_image.height()))
184+
self.rendered_image.height()))
185185

186186
max_width = min(
187187
self.rendered_image.width(), self.control_image.width())

‎tests/src/python/test_qgssymbollayerutils.py‎

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -53,43 +53,6 @@ def testEncodeDecodePoint(self):
5353
s2 = QgsSymbolLayerUtils.decodePoint('')
5454
self.assertEqual(s2, QPointF())
5555

56-
def testConvertToMapUnits(self):
57-
# test QgsSymbolLayerUtils::convertToMapUnits() without QgsMapUnitScale
58-
59-
ms = QgsMapSettings()
60-
ms.setExtent(QgsRectangle(0, 0, 100, 100))
61-
ms.setOutputSize(QSize(100, 50))
62-
ms.setOutputDpi(300)
63-
r = QgsRenderContext.fromMapSettings(ms)
64-
65-
# renderer scale should be about 1:291937841
66-
size = QgsSymbolLayerUtils.convertToMapUnits(r, 2, QgsUnitTypes.RenderMapUnits)
67-
self.assertEqual(size, 2.0)
68-
size = QgsSymbolLayerUtils.convertToMapUnits(r, 2, QgsUnitTypes.RenderMillimeters)
69-
self.assertAlmostEqual(size, 47.244094, places=5)
70-
size = QgsSymbolLayerUtils.convertToMapUnits(r, 5.66929, QgsUnitTypes.RenderPoints)
71-
self.assertAlmostEqual(size, 47.2440833, places=5)
72-
size = QgsSymbolLayerUtils.convertToMapUnits(r, 2, QgsUnitTypes.RenderPixels)
73-
self.assertAlmostEqual(size, 4.0, places=5)
74-
75-
def testConvertFromMapUnits(self):
76-
# test QgsSymbolLayerUtils::convertToMapUnits() without QgsMapUnitScale
77-
78-
ms = QgsMapSettings()
79-
ms.setExtent(QgsRectangle(0, 0, 100, 100))
80-
ms.setOutputSize(QSize(100, 50))
81-
ms.setOutputDpi(300)
82-
r = QgsRenderContext.fromMapSettings(ms)
83-
84-
# renderer scale should be about 1:291937841
85-
size = QgsSymbolLayerUtils.convertFromMapUnits(r, 2, QgsUnitTypes.RenderMapUnits)
86-
self.assertEqual(size, 2.0)
87-
size = QgsSymbolLayerUtils.convertFromMapUnits(r, 50, QgsUnitTypes.RenderMillimeters)
88-
self.assertAlmostEqual(size, 2.1166666666, places=5)
89-
size = QgsSymbolLayerUtils.convertFromMapUnits(r, 50, QgsUnitTypes.RenderPoints)
90-
self.assertAlmostEqual(size, 6.0000000015, places=5)
91-
size = QgsSymbolLayerUtils.convertFromMapUnits(r, 4, QgsUnitTypes.RenderPixels)
92-
self.assertAlmostEqual(size, 2.0, places=5)
9356

9457
if __name__ == '__main__':
9558
unittest.main()
403 Bytes
Loading
279 Bytes
Loading
405 Bytes
Loading
634 Bytes
Loading
346 Bytes
Loading
180 Bytes
Loading
349 Bytes
Loading

0 commit comments

Comments
 (0)