Skip to content
Permalink
Browse files

Tidy up for py geometry tests

  • Loading branch information
timlinux committed Aug 26, 2012
1 parent 55d4ca9 commit 13ab193f26f6dd0dbce2c7968008ea5c16606b34
Showing with 2 additions and 13 deletions.
  1. +2 −13 tests/src/python/test_qgsgeometry.py
@@ -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))

0 comments on commit 13ab193

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