Skip to content

Commit

Permalink
Update test_qgsgeometry.py
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Oct 9, 2023
1 parent dbc733b commit e64bab8
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions tests/src/python/test_qgsgeometry.py
Expand Up @@ -7107,13 +7107,8 @@ def testIntersectsMultiPolygonEmptyRect(self):
self.assertTrue(poly.intersects(bbox)) # was failing here!

def testSplitGeometry(self):
"""
splitGeometry takes either QVector<QgsPoint> or QVector<QgsPointXY>
testing the overloaded methods until the QgsPointXY variant is removed in QGIS 4.0
this could be potentially removed in favor of the existing cpp test which will be sufficient
"""
square = QgsGeometry.fromWkt("Polygon ((0 0, 0 2, 2 2, 2 0, 0 0))")
line = [QgsPoint(1, -1), QgsPoint(1, 3)]

square = QgsGeometry.fromWkt("Polygon ((0 0, 0 2, 2 2, 2 0, 0 0))")
lineXY = [QgsPointXY(1, -1), QgsPointXY(1, 3)]

r1 = QgsGeometry.fromWkt("Polygon ((1 2, 1 0, 0 0, 0 2, 1 2))")
Expand All @@ -7125,12 +7120,6 @@ def testSplitGeometry(self):
self.assertEqual(len(parts), 1)
self.assertGeometriesEqual(parts[0], r1)

square = QgsGeometry.fromWkt("Polygon ((0 0, 0 2, 2 2, 2 0, 0 0))")
(result, parts, topo) = square.splitGeometry(line, False)
self.assertEqual(result, Qgis.GeometryOperationResult.Success)
self.assertGeometriesEqual(square, r2)
self.assertGeometriesEqual(parts[0], r1)

multilinestring = QgsGeometry.fromWkt("MultiLinestring((0 1, 1 0),(0 2, 2 0))")
blade = QgsCompoundCurve()
blade.addCurve(QgsLineString([QgsPointXY(0.8, 0.8), QgsPointXY(1.2, 1.2)]))
Expand Down

0 comments on commit e64bab8

Please sign in to comment.