Skip to content

Commit e358a87

Browse files
committedJun 25, 2014
add some more geometry tests (followup c686c4f)
1 parent 97e7f0a commit e358a87

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎tests/src/python/test_qgsgeometry.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,13 @@ def testDeleteVertex(self):
903903
wkt = polyline.exportToWkt()
904904
assert compareWkt( expwkt, wkt ), "Expected:\n%s\nGot:\n%s\n" % (expwkt, wkt )
905905

906+
polyline = QgsGeometry.fromWkt("MULTILINESTRING((0 0, 1 0, 1 1, 2 1,2 0),(3 0, 3 1, 5 1, 5 0, 6 0))")
907+
for i in range(5):
908+
assert polyline.deleteVertex(5), "Delete vertex 5 failed"
909+
expwkt = "MULTILINESTRING((0 0, 1 0, 1 1, 2 1, 2 0))"
910+
wkt = polyline.exportToWkt()
911+
assert compareWkt( expwkt, wkt ), "Expected:\n%s\nGot:\n%s\n" % (expwkt, wkt )
912+
906913
# 5---4
907914
# | |
908915
# | 2-3
@@ -950,6 +957,14 @@ def testDeleteVertex(self):
950957
wkt = polygon.exportToWkt()
951958
assert compareWkt( expwkt, wkt ), "Expected:\n%s\nGot:\n%s\n" % (expwkt, wkt )
952959

960+
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)))" )
961+
for i in range(6):
962+
assert polygon.deleteVertex( 0 ), "Delete vertex 0 failed"
963+
964+
expwkt = "MULTIPOLYGON(((4 0,5 0,5 2,3 2,3 1,4 1,4 0)))"
965+
wkt = polygon.exportToWkt()
966+
assert compareWkt( expwkt, wkt ), "Expected:\n%s\nGot:\n%s\n" % (expwkt, wkt )
967+
953968
# 3-+-+-+-+-+-+-+-+-2
954969
# | |
955970
# + 8-7 3-2 8-7 3-2 +

0 commit comments

Comments
 (0)
Please sign in to comment.