Skip to content
Permalink
Browse files

Convert some asserts to self.asserXXX methods in py tests

  • Loading branch information
m-kuhn committed Mar 10, 2016
1 parent e6198c6 commit 8d72e9f44c3a1958e6d6cbc8bda7700697a32729
Showing with 7 additions and 7 deletions.
  1. +7 −7 tests/src/python/test_provider_shapefile.py
@@ -49,7 +49,7 @@ def setUpClass(cls):
cls.repackfile = os.path.join(cls.repackfilepath, 'shapefile.shp')
cls.basetestpolyfile = os.path.join(cls.basetestpath, 'shapefile_poly.shp')
cls.vl = QgsVectorLayer(u'{}|layerid=0'.format(cls.basetestfile), u'test', u'ogr')
assert (cls.vl.isValid())
assert(cls.vl.isValid())
cls.provider = cls.vl.dataProvider()
cls.vl_poly = QgsVectorLayer(u'{}|layerid=0'.format(cls.basetestpolyfile), u'test', u'ogr')
assert (cls.vl_poly.isValid())
@@ -72,12 +72,12 @@ def testRepack(self):

ids = [f.id() for f in vl.getFeatures(QgsFeatureRequest().setFilterExpression('pk=1'))]
vl.setSelectedFeatures(ids)
assert vl.selectedFeaturesIds() == ids, vl.selectedFeaturesIds()
assert vl.pendingFeatureCount() == 5, vl.pendingFeatureCount()
assert vl.startEditing()
assert vl.deleteFeature(3)
assert vl.commitChanges()
assert vl.selectedFeatureCount() == 0 or vl.selectedFeatures()[0]['pk'] == 1
self.assertEquals(vl.selectedFeaturesIds(), ids)
self.assertEquals(vl.pendingFeatureCount(), 5)
self.assertTrue(vl.startEditing())
self.assertTrue(vl.deleteFeature(3))
self.assertTrue(vl.commitChanges())
self.assertTrue(vl.selectedFeatureCount() == 0 or vl.selectedFeatures()[0]['pk'] == 1)


if __name__ == '__main__':

0 comments on commit 8d72e9f

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