Skip to content
Permalink
Browse files
fix some tests broken by vector API cleanup
  • Loading branch information
alexbruy committed Mar 19, 2013
1 parent eb87842 commit a9074c2bc1e6884c8883984505ddd545b7c790f7
Showing with 6 additions and 11 deletions.
  1. +4 −9 tests/src/python/test_qgsfeature.py
  2. +2 −2 tests/src/python/test_qgsgeometry.py
@@ -41,11 +41,9 @@ def test_ValidFeature(self):
myPath = os.path.join(unitTestDataPath(), 'points.shp')
myLayer = QgsVectorLayer(myPath, 'Points', 'ogr')
provider = myLayer.dataProvider()
allAttrs = provider.attributeIndexes()
myLayer.select(allAttrs)

fit = provider.getFeatures()
feat = QgsFeature()
myLayer.nextFeature(feat)
fit.nextFeature(feat)
myValidValue = feat.isValid()
myMessage = '\nExpected: %s\nGot: %s' % ("True", myValidValue)
assert myValidValue == True, myMessage
@@ -54,11 +52,9 @@ def test_Attributes(self):
myPath = os.path.join(unitTestDataPath(), 'lines.shp')
myLayer = QgsVectorLayer(myPath, 'Lines', 'ogr')
provider = myLayer.dataProvider()
allAttrs = provider.attributeIndexes()
myLayer.select(allAttrs)
fit = provider.getFeatures()
feat = QgsFeature()
myLayer.nextFeature(feat)

fit.nextFeature(feat)
myAttributes = feat.attributes()
myExpectedAttributes = [ QVariant("Highway"), QVariant(1) ]

@@ -94,4 +90,3 @@ def test_SetGeometry(self):

if __name__ == '__main__':
unittest.main()

@@ -302,10 +302,10 @@ def testClipping(self):
)
print 'Clip: %s' % myClipPolygon.exportToWkt()
writeShape(myMemoryLayer, 'clipGeometryBefore.shp')
myMemoryLayer.select(myProvider.attributeIndexes())
fit = myProvider.getFeatures()
myFeatures = []
myFeature = QgsFeature()
while myMemoryLayer.nextFeature(myFeature):
while fit.nextFeature(myFeature):
myGeometry = myFeature.geometry()
if myGeometry.intersects(myClipPolygon):
# Adds nodes where the clip and the line intersec

0 comments on commit a9074c2

Please sign in to comment.