Skip to content
Permalink
Browse files

Fix tests

  • Loading branch information
nyalldawson committed Oct 25, 2017
1 parent 72321c9 commit 837c1c56eb573919c4e1c70ac2935226d504b83b
Showing with 4 additions and 4 deletions.
  1. +2 −2 python/testing/__init__.py
  2. +2 −2 tests/src/python/test_qgsgeometry.py
@@ -118,11 +118,11 @@ def sort_by_pk_or_fid(f):

for feats in zip(expected_features, result_features):
if feats[0].hasGeometry():
geom0 = feats[0].geometry().geometry().asWkt(precision)
geom0 = feats[0].geometry().constGet().asWkt(precision)
else:
geom0 = None
if feats[1].hasGeometry():
geom1 = feats[1].geometry().geometry().asWkt(precision)
geom1 = feats[1].geometry().constGet().asWkt(precision)
else:
geom1 = None
if use_asserts:
@@ -70,7 +70,7 @@ def testBool(self):
myWKT = 'Point (10 10)'
g = QgsGeometry.fromWkt(myWKT)
self.assertTrue(g)
g.setGeometry(None)
g.set(None)
self.assertFalse(g)

def testIsEmpty(self):
@@ -1974,7 +1974,7 @@ def testRelates(self):
assert geom1, "Relates {} failed: could not create geom:\n{}\n".format(i + 1, test_data[0])
geom2 = QgsGeometry.fromWkt(test_data[1])
assert geom2, "Relates {} failed: could not create geom:\n{}\n".format(i + 1, test_data[1])
result = QgsGeometry.createGeometryEngine(geom1.geometry()).relate(geom2.geometry())
result = QgsGeometry.createGeometryEngine(geom1.constGet()).relate(geom2.constGet())
exp = test_data[2]
self.assertEqual(result, exp, "Relates {} failed: mismatch Expected:\n{}\nGot:\n{}\nGeom1:\n{}\nGeom2:\n{}\n".format(i + 1, exp, result, test_data[0], test_data[1]))

0 comments on commit 837c1c5

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