Skip to content
Permalink
Browse files

Isolate test failures with subset string modification

  • Loading branch information
m-kuhn committed Jun 4, 2018
1 parent 5d3a4cd commit 280e10e6d10429b6baaae920a3bc5a1f2eef1242
Showing with 13 additions and 12 deletions.
  1. +13 −12 tests/src/python/providertestbase.py
@@ -421,19 +421,20 @@ def testEmpty(self):
self.assertEqual(self.source.hasFeatures(), QgsFeatureSource.FeaturesAvailable)

if self.source.supportsSubsetString():
backup = self.source.subsetString()
# Add a subset string and test feature count
subset = self.getSubsetString()
self.source.setSubsetString(subset)
self.assertFalse(self.source.empty())
self.assertEqual(self.source.hasFeatures(), QgsFeatureSource.FeaturesAvailable)
subsetNoMatching = self.getSubsetStringNoMatching()
self.source.setSubsetString(subsetNoMatching)
self.assertTrue(self.source.empty())
self.assertEqual(self.source.hasFeatures(), QgsFeatureSource.NoFeaturesAvailable)
self.source.setSubsetString(None)
try:
backup = self.source.subsetString()
# Add a subset string and test feature count
subset = self.getSubsetString()
self.source.setSubsetString(subset)
self.assertFalse(self.source.empty())
self.assertEqual(self.source.hasFeatures(), QgsFeatureSource.FeaturesAvailable)
subsetNoMatching = self.getSubsetStringNoMatching()
self.source.setSubsetString(subsetNoMatching)
self.assertTrue(self.source.empty())
self.assertEqual(self.source.hasFeatures(), QgsFeatureSource.NoFeaturesAvailable)
finally:
self.source.setSubsetString(None)
self.assertFalse(self.source.empty())
self.source.setSubsetString(backup)

# If the provider supports tests on editable layers
if getattr(self, 'getEditableLayer', None):

0 comments on commit 280e10e

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