mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
Add core unit test
This commit is contained in:
parent
7681d308e2
commit
80e19b6328
@ -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
BIN
tests/testdata/provider/bug_19826.gpkg
vendored
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user