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

(cherry-picked from 243052)
  • Loading branch information
nyalldawson committed Jul 10, 2018
1 parent c473ac0 commit 4c89d58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/src/python/featuresourcetestbase.py
Original file line number Diff line number Diff line change
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 4c89d58

Please sign in to comment.