Skip to content

Commit 43fc565

Browse files
uclarosnyalldawson
uclaros
authored andcommittedMar 21, 2019
nose2 method assertions
1 parent 09dcf84 commit 43fc565

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎tests/src/python/test_qgsgeometry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,13 +2338,13 @@ def testReshape(self):
23382338
g = QgsGeometry.fromWkt('Polygon ((0 0, 1 0, 1 1, 0 1, 0 0))')
23392339
expWkt = g.asWkt()
23402340
g.reshapeGeometry(QgsLineString([QgsPoint(0, 0), QgsPoint(-1, -1)]))
2341-
assert compareWkt(g.asWkt(), expWkt), "testReshape failed: mismatch Expected:\n%s\nGot:\n%s\n" % (expWkt, wkt)
2341+
self.assertTrue(compareWkt(g.asWkt(), expWkt), "testReshape failed: mismatch Expected:\n%s\nGot:\n%s\n" % (expWkt, wkt))
23422342

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.