Core: fixes #8119: Make axis values in Property view persistent

This commit is contained in:
wmayer
2023-01-02 12:48:40 +01:00
parent 0c841d8074
commit 0566ba0a9e
2 changed files with 24 additions and 2 deletions

View File

@@ -258,6 +258,28 @@ class DocumentBasicCases(unittest.TestCase):
cpy = self.Doc.copyObject(obj)
self.assertListEqual(obj.PlmList, cpy.PlmList)
def testRawAxis(self):
obj = self.Doc.addObject("App::FeaturePython","Label")
obj.addProperty("App::PropertyPlacement", "Plm")
obj.addProperty("App::PropertyRotation", "Rot")
obj.Plm.Rotation.Axis = (1,2,3)
obj.Rot.Axis = (3,2,1)
# saving and restoring
SaveName = tempfile.gettempdir() + os.sep + "CreateTest.FCStd"
self.Doc.saveAs(SaveName)
FreeCAD.closeDocument("CreateTest")
self.Doc = FreeCAD.open(SaveName)
obj = self.Doc.ActiveObject
self.assertEqual(obj.Plm.Rotation.RawAxis.x, 1)
self.assertEqual(obj.Plm.Rotation.RawAxis.y, 2)
self.assertEqual(obj.Plm.Rotation.RawAxis.z, 3)
self.assertEqual(obj.Rot.RawAxis.x, 3)
self.assertEqual(obj.Rot.RawAxis.y, 2)
self.assertEqual(obj.Rot.RawAxis.z, 1)
def testAddRemove(self):
L1 = self.Doc.addObject("App::FeatureTest","Label_1")
# must delete object