Skip to content

Commit

Permalink
Add core unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere authored and nyalldawson committed Oct 7, 2018
1 parent 7681d30 commit 80e19b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/src/python/test_provider_ogr_gpkg.py
Expand Up @@ -280,6 +280,17 @@ def testSelectSubsetString(self):
got = [feat for feat in vl.getFeatures()]
self.assertEqual(len(got), 1)

testdata_path = unitTestDataPath('provider')
gpkg = os.path.join(testdata_path, 'bug_19826.gpkg')
vl = QgsVectorLayer('{}|layerid=0'.format(gpkg, 'test', 'ogr'))
vl.setSubsetString("name = 'two'")
got = [feat for feat in vl.getFeatures()]
self.assertEqual(len(got), 1)

attributes = got[0].attributes()
self.assertEqual(attributes[0], 2)
self.assertEqual(attributes[1], 'two')

def testStyle(self):

# First test with invalid URI
Expand Down
Binary file added tests/testdata/provider/bug_19826.gpkg
Binary file not shown.

0 comments on commit 80e19b6

Please sign in to comment.