Skip to content

Commit

Permalink
Tidy up for py geometry tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Aug 26, 2012
1 parent 55d4ca9 commit 13ab193
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions tests/src/python/test_qgsgeometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,9 @@ def testBuffer(self):
myMessage = ('Expected:\n%s\nGot:\n%s\n' %
(QGis.Polygon, bufferGeom.type()))
assert bufferGeom.wkbType() == QGis.WKBPolygon, myMessage
myTestPoint = QgsGeometry.fromPoint(QgsPoint(3, 3))
assert bufferGeom.intersects(myTestPoint)

layer = QgsVectorLayer("Polygon", "buffer", "memory")
assert layer.isValid(), "Failed to create valid polygon memory layer"

provider = layer.dataProvider()

ft = QgsFeature()
ft.setGeometry(bufferGeom)
provider.addFeatures([ft])

myMessage = ('Expected:\n%s\nGot:\n%s\n' %
(1, layer.featureCount()))
assert layer.featureCount() == 1, myMessage

def testContains(self):
myPoly = QgsGeometry.fromPolygon([[QgsPoint(0, 0),QgsPoint(2, 0),QgsPoint(2, 2),QgsPoint(0, 2), QgsPoint(0, 0)]])
myPoint = QgsGeometry.fromPoint(QgsPoint(1, 1))
Expand Down

0 comments on commit 13ab193

Please sign in to comment.