Skip to content

Commit

Permalink
Add feature source test to ensure that empty setFilterFids list resul…
Browse files Browse the repository at this point in the history
…ts in no features
  • Loading branch information
nyalldawson committed Jul 5, 2018
1 parent ef6ce4e commit 2430529
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/src/python/featuresourcetestbase.py
Expand Up @@ -425,6 +425,11 @@ def testGetFeaturesFidsTests(self):
fids = [f.id() for f in self.source.getFeatures()]
self.assertEqual(len(fids), 5)

# empty list = no features
request = QgsFeatureRequest().setFilterFids([])
result = set([f.id() for f in self.source.getFeatures(request)])
self.assertFalse(result)

request = QgsFeatureRequest().setFilterFids([fids[0], fids[2]])
result = set([f.id() for f in self.source.getFeatures(request)])
all_valid = (all(f.isValid() for f in self.source.getFeatures(request)))
Expand Down

0 comments on commit 2430529

Please sign in to comment.