Skip to content
Permalink
Browse files

Add feature source test to ensure that empty setFilterFids list resul…

…ts in no features

(cherry-picked from 243052)
  • Loading branch information
nyalldawson committed Jul 4, 2018
1 parent c473ac0 commit 4c89d581b6a32080bc465db7519dee2e787b6800
Showing with 5 additions and 0 deletions.
  1. +5 −0 tests/src/python/featuresourcetestbase.py
@@ -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)))

0 comments on commit 4c89d58

Please sign in to comment.
You can’t perform that action at this time.