unit test: remove property while transaction is active and abort it later
This commit is contained in:
@@ -965,6 +965,8 @@ class DocumentPlatformCases(unittest.TestCase):
|
||||
def tearDown(self):
|
||||
#closing doc
|
||||
FreeCAD.closeDocument("PlatformTests")
|
||||
|
||||
|
||||
class DocumentFileIncludeCases(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.Doc = FreeCAD.newDocument("FileIncludeTests")
|
||||
@@ -1103,6 +1105,17 @@ class DocumentPropertyCases(unittest.TestCase):
|
||||
FreeCAD.closeDocument("PropertyTests")
|
||||
self.Doc = FreeCAD.open(tempFile)
|
||||
|
||||
def testRemoveProperty(self):
|
||||
prop = 'Something'
|
||||
self.Obj.addProperty('App::PropertyFloat', prop)
|
||||
self.Obj.Something = 0.01
|
||||
self.Doc.recompute()
|
||||
self.Doc.openTransaction('modify and remove property')
|
||||
self.Obj.Something = 0.00
|
||||
self.Obj.removeProperty(prop)
|
||||
self.Obj.recompute()
|
||||
self.Doc.abortTransaction()
|
||||
|
||||
def tearDown(self):
|
||||
#closing doc
|
||||
FreeCAD.closeDocument("PropertyTests")
|
||||
|
||||
Reference in New Issue
Block a user