Add core unit test

This commit is contained in:
Blottiere Paul 2018-10-01 12:48:37 +01:00 committed by Nyall Dawson
parent 7681d308e2
commit 80e19b6328
2 changed files with 11 additions and 0 deletions

View File

@ -280,6 +280,17 @@ class TestPyQgsOGRProviderGpkg(unittest.TestCase):
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

BIN
tests/testdata/provider/bug_19826.gpkg vendored Normal file

Binary file not shown.