Skip to content
Permalink
Browse files

Fix test for 3.10

(cherry picked from commit 9d5b89f)
  • Loading branch information
elpaso authored and nyalldawson committed Sep 11, 2020
1 parent 1382c4b commit ed0484132c23b0fbe365f5083828ddbc93054ee7
Showing with 3 additions and 2 deletions.
  1. +3 −2 tests/src/python/test_provider_virtual.py
@@ -1088,6 +1088,7 @@ def test_filter_rect_precise(self):
self.assertEqual(len(features), 16)

QgsProject.instance().removeMapLayer(pl)

def test_subset_string(self):
"""Test that subset strings are stored and restored correctly from the project
See: GH #26189
@@ -1177,14 +1178,14 @@ def test_subset_string(self):
self.assertEqual(virtual.featureCount(), 2)
self.assertTrue(virtual.setSubsetString('"join_value" = \'twenty\''))
self.assertEqual(virtual.featureCount(), 1)
self.assertEqual([f.attributes() for f in virtual.getFeatures()], [[1, 20, 2, 'twenty']])
self.assertEqual([f.attributes() for f in virtual.getFeatures()], [[1, 1, 20, 2, 'twenty']])

# Store and reload the project
self.assertTrue(project.write(project_path))
self.assertTrue(project.read(project_path))
gpkg_virtual_layer = project.mapLayersByName('virtual_data')[0]
self.assertEqual(gpkg_virtual_layer.featureCount(), 1)
self.assertEqual(gpkg_virtual_layer.subsetString(), '"join_value" = \'twenty\'')
self.assertEqual(gpkg_virtual_layer.featureCount(), 1)


if __name__ == '__main__':

0 comments on commit ed04841

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