Skip to content
Permalink
Browse files

Adjust leftovers addPointsV2 to addPoints

  • Loading branch information
m-kuhn committed Oct 29, 2017
1 parent ca74e39 commit bde014ec7b9af461ebc6462c18151a5f6b42f2da
Showing with 3 additions and 3 deletions.
  1. +3 −3 tests/src/python/test_qgsgeometry.py
@@ -1423,7 +1423,7 @@ def testAddPart(self):
# test adding a part with Z values
point = QgsGeometry.fromPoint(points[0])
point.get().addZValue(4.0)
self.assertEqual(point.addPointsV2([QgsPoint(points[1][0], points[1][1], 3.0, wkbType=QgsWkbTypes.PointZ)]), 0)
self.assertEqual(point.addPoints([QgsPoint(points[1][0], points[1][1], 3.0, wkbType=QgsWkbTypes.PointZ)]), 0)
expwkt = "MultiPointZ ((0 0 4), (1 0 3))"
wkt = point.exportToWkt()
assert compareWkt(expwkt, wkt), "Expected:\n%s\nGot:\n%s\n" % (expwkt, wkt)
@@ -1453,7 +1453,7 @@ def testAddPart(self):
polyline = QgsGeometry.fromPolylineXY(points[0])
polyline.get().addZValue(4.0)
points2 = [QgsPoint(p[0], p[1], 3.0, wkbType=QgsWkbTypes.PointZ) for p in points[1]]
self.assertEqual(polyline.addPointsV2(points2), QgsGeometry.Success)
self.assertEqual(polyline.addPoints(points2), QgsGeometry.Success)
expwkt = "MultiLineStringZ ((0 0 4, 1 0 4, 1 1 4, 2 1 4, 2 0 4),(3 0 3, 3 1 3, 5 1 3, 5 0 3, 6 0 3))"
wkt = polyline.exportToWkt()
assert compareWkt(expwkt, wkt), "Expected:\n%s\nGot:\n%s\n" % (expwkt, wkt)
@@ -1497,7 +1497,7 @@ def testAddPart(self):
polygon = QgsGeometry.fromPolygon(points[0])
polygon.get().addZValue(4.0)
points2 = [QgsPoint(pi[0], pi[1], 3.0, wkbType=QgsWkbTypes.PointZ) for pi in points[1][0]]
self.assertEqual(polygon.addPointsV2(points2), QgsGeometry.Success)
self.assertEqual(polygon.addPoints(points2), QgsGeometry.Success)
expwkt = "MultiPolygonZ (((0 0 4, 1 0 4, 1 1 4, 2 1 4, 2 2 4, 0 2 4, 0 0 4)),((4 0 3, 5 0 3, 5 2 3, 3 2 3, 3 1 3, 4 1 3, 4 0 3)))"
wkt = polygon.exportToWkt()
assert compareWkt(expwkt, wkt), "Expected:\n%s\nGot:\n%s\n" % (expwkt, wkt)

0 comments on commit bde014e

Please sign in to comment.
You can’t perform that action at this time.