Skip to content
Permalink
Browse files

nose2 method assertions

  • Loading branch information
uclaros authored and nyalldawson committed Mar 21, 2019
1 parent 4721ded commit 2595bfe60084dbf6ac0f7d9654cd18bafb089d99
Showing with 3 additions and 3 deletions.
  1. +3 −3 tests/src/python/test_qgsgeometry.py
@@ -2275,13 +2275,13 @@ def testReshape(self):
g = QgsGeometry.fromWkt('Polygon ((0 0, 1 0, 1 1, 0 1, 0 0))')
expWkt = g.asWkt()
g.reshapeGeometry(QgsLineString([QgsPoint(0, 0), QgsPoint(-1, -1)]))
assert compareWkt(g.asWkt(), expWkt), "testReshape failed: mismatch Expected:\n%s\nGot:\n%s\n" % (expWkt, wkt)
self.assertTrue(compareWkt(g.asWkt(), expWkt), "testReshape failed: mismatch Expected:\n%s\nGot:\n%s\n" % (expWkt, wkt))

# Test reshape a polygon with a line starting or ending at the polygon's first vertex
g = QgsGeometry.fromWkt('Polygon ((0 0, 1 0, 1 1, 0 1, 0 0))')
g.reshapeGeometry(QgsLineString([QgsPoint(0, 0), QgsPoint(0.5, 0.5), QgsPoint(0, 1)]))
self.assertEqual(g.reshapeGeometry(QgsLineString([QgsPoint(0, 0), QgsPoint(0.5, 0.5), QgsPoint(0, 1)])), QgsGeometry.Success)
expWkt = 'Polygon ((0 0, 1 0, 1 1, 0 1, 0.5 0.5, 0 0))'
assert compareWkt(g.asWkt(), expWkt), "testReshape failed: mismatch Expected:\n%s\nGot:\n%s\n" % (expWkt, wkt)
self.assertTrue(compareWkt(g.asWkt(), expWkt), "testReshape failed: mismatch Expected:\n%s\nGot:\n%s\n" % (expWkt, wkt))

# Test reshape a line from first/last vertex
g = QgsGeometry.fromWkt('LineString (0 0, 5 0, 5 1)')

0 comments on commit 2595bfe

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