Skip to content

Commit 80e19b6

Browse files
pblottierenyalldawson
authored andcommittedOct 7, 2018
Add core unit test
1 parent 7681d30 commit 80e19b6

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
 

‎tests/src/python/test_provider_ogr_gpkg.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,17 @@ def testSelectSubsetString(self):
280280
got = [feat for feat in vl.getFeatures()]
281281
self.assertEqual(len(got), 1)
282282

283+
testdata_path = unitTestDataPath('provider')
284+
gpkg = os.path.join(testdata_path, 'bug_19826.gpkg')
285+
vl = QgsVectorLayer('{}|layerid=0'.format(gpkg, 'test', 'ogr'))
286+
vl.setSubsetString("name = 'two'")
287+
got = [feat for feat in vl.getFeatures()]
288+
self.assertEqual(len(got), 1)
289+
290+
attributes = got[0].attributes()
291+
self.assertEqual(attributes[0], 2)
292+
self.assertEqual(attributes[1], 'two')
293+
283294
def testStyle(self):
284295

285296
# First test with invalid URI
96 KB
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.