Skip to content
Browse files

Add a test for python provider using both direct iterator and iterato…

…r from layer
  • Loading branch information
nyalldawson committed Feb 8, 2021
1 parent 4984de7 commit e509e653030396c95086baaae69c2cc7148e4687
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/src/python/
@@ -402,6 +402,18 @@ def tesRegisterSameProviderTwice(self):
metadata = QgsProviderMetadata(PyProvider.providerKey(), PyProvider.description(), PyProvider.createProvider)

def testGetFeaturesFromProvider(self):
Regardless of whether we get features direct from the provider or through the layer, the
result should be the same...
layer = self.createLayer()
provider_features = { f.attributes() for f in layer.dataProvider().getFeatures()}
layer_features = { f.attributes() for f in layer.dataProvider().getFeatures()}
self.assertEqual(provider_features, layer_features)

if __name__ == '__main__':

0 comments on commit e509e65

Please sign in to comment.