Skip to content
Permalink
Browse files

Add test for combination orderby / subset of attributes

  • Loading branch information
m-kuhn committed Dec 21, 2015
1 parent 3dc832a commit 3f1db6d55002b89c57402a4f88c2b482017abe9f
Showing with 5 additions and 0 deletions.
  1. +5 −0 tests/src/python/providertestbase.py
@@ -185,6 +185,11 @@ def testOrderBy(self):
values = [f['pk'] for f in self.provider.getFeatures(request)]
self.assertEquals(values, [5, 4])

# Combination with subset of attributes
request = QgsFeatureRequest().addOrderBy('num_char', False).setSubsetOfAttributes(['pk'], self.vl.fields())
values = [f['pk'] for f in self.vl.getFeatures(request)]
self.assertEquals(values, [5, 4, 3, 2, 1])

def testGetFeaturesFidTests(self):
fids = [f.id() for f in self.provider.getFeatures()]
assert len(fids) == 5, 'Expected 5 features, got {} instead'.format(len(fids))

0 comments on commit 3f1db6d

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