@@ -41,11 +41,9 @@ def test_ValidFeature(self):
41
41
myPath = os .path .join (unitTestDataPath (), 'points.shp' )
42
42
myLayer = QgsVectorLayer (myPath , 'Points' , 'ogr' )
43
43
provider = myLayer .dataProvider ()
44
- allAttrs = provider .attributeIndexes ()
45
- myLayer .select (allAttrs )
46
-
44
+ fit = provider .getFeatures ()
47
45
feat = QgsFeature ()
48
- myLayer .nextFeature (feat )
46
+ fit .nextFeature (feat )
49
47
myValidValue = feat .isValid ()
50
48
myMessage = '\n Expected: %s\n Got: %s' % ("True" , myValidValue )
51
49
assert myValidValue == True , myMessage
@@ -54,11 +52,9 @@ def test_Attributes(self):
54
52
myPath = os .path .join (unitTestDataPath (), 'lines.shp' )
55
53
myLayer = QgsVectorLayer (myPath , 'Lines' , 'ogr' )
56
54
provider = myLayer .dataProvider ()
57
- allAttrs = provider .attributeIndexes ()
58
- myLayer .select (allAttrs )
55
+ fit = provider .getFeatures ()
59
56
feat = QgsFeature ()
60
- myLayer .nextFeature (feat )
61
-
57
+ fit .nextFeature (feat )
62
58
myAttributes = feat .attributes ()
63
59
myExpectedAttributes = [ QVariant ("Highway" ), QVariant (1 ) ]
64
60
@@ -94,4 +90,3 @@ def test_SetGeometry(self):
94
90
95
91
if __name__ == '__main__' :
96
92
unittest .main ()
97
-
0 commit comments