Skip to content

Commit

Permalink
fix some tests broken by vector API cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Mar 19, 2013
1 parent eb87842 commit a9074c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions tests/src/python/test_qgsfeature.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) ]

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

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

4 changes: 2 additions & 2 deletions tests/src/python/test_qgsgeometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9074c2

Please sign in to comment.