Skip to content

Commit abc975f

Browse files
uclarosuclaros
uclaros
authored and
uclaros
committed
nose2 method assertions
1 parent 1fc2747 commit abc975f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/src/python/test_qgsgeometry.py

+3-3
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)