Skip to content

Commit

Permalink
Convert some asserts to self.asserXXX methods in py tests
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 10, 2016
1 parent e6198c6 commit 8d72e9f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/src/python/test_provider_shapefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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__':
Expand Down

0 comments on commit 8d72e9f

Please sign in to comment.