Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update test_qgsgeometry
  • Loading branch information
mhugent committed Jan 4, 2016
1 parent d019900 commit 7f978d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/src/python/test_qgsgeometry.py
Expand Up @@ -1020,7 +1020,7 @@ def testDeleteVertex(self):
assert compareWkt(expwkt, wkt), "Expected:\n%s\nGot:\n%s\n" % (expwkt, wkt)

polyline = QgsGeometry.fromWkt("MultiLineString ((0 0, 1 0, 1 1, 2 1,2 0),(3 0, 3 1, 5 1, 5 0, 6 0))")
for i in range(5):
for i in range(4):
assert polyline.deleteVertex(5), "Delete vertex 5 failed"
expwkt = "MultiLineString ((0 0, 1 0, 1 1, 2 1, 2 0))"
wkt = polyline.exportToWkt()
Expand Down Expand Up @@ -1074,7 +1074,7 @@ def testDeleteVertex(self):
assert compareWkt(expwkt, wkt), "Expected:\n%s\nGot:\n%s\n" % (expwkt, wkt)

polygon = QgsGeometry.fromWkt("MultiPolygon (((0 0, 1 0, 1 1, 2 1, 2 2, 0 2, 0 0)),((4 0, 5 0, 5 2, 3 2, 3 1, 4 1, 4 0)))")
for i in range(6):
for i in range(4):
assert polygon.deleteVertex(0), "Delete vertex 0 failed"

expwkt = "MultiPolygon (((4 0, 5 0, 5 2, 3 2, 3 1, 4 1, 4 0)))"
Expand All @@ -1091,15 +1091,15 @@ def testDeleteVertex(self):
polygon = QgsGeometry.fromWkt("Polygon ((0 0, 9 0, 9 3, 0 3, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1),(3 1, 4 1, 4 2, 3 2, 3 1),(5 1, 6 1, 6 2, 5 2, 5 1),(7 1, 8 1, 8 2, 7 2, 7 1))")
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

for i in range(4):
for i in range(2):
assert polygon.deleteVertex(16), "Delete vertex 16 failed" % i

expwkt = "Polygon ((0 0, 9 0, 9 3, 0 3, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1),(3 1, 4 1, 4 2, 3 2, 3 1),(7 1, 8 1, 8 2, 7 2, 7 1))"
wkt = polygon.exportToWkt()
assert compareWkt(expwkt, wkt), "Expected:\n%s\nGot:\n%s\n" % (expwkt, wkt)

for i in range(3):
for j in range(4):
for j in range(2):
assert polygon.deleteVertex(5), "Delete vertex 5 failed" % i

expwkt = "Polygon ((0 0, 9 0, 9 3, 0 3, 0 0))"
Expand All @@ -1108,7 +1108,7 @@ def testDeleteVertex(self):

# Remove whole outer ring, inner ring should become outer
polygon = QgsGeometry.fromWkt("Polygon ((0 0, 9 0, 9 3, 0 3, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1))")
for i in range(4):
for i in range(2):
assert polygon.deleteVertex(0), "Delete vertex 16 failed" % i

expwkt = "Polygon ((1 1, 2 1, 2 2, 1 2, 1 1))"
Expand Down

0 comments on commit 7f978d9

Please sign in to comment.