App: fix failure to detect cyclic dependencies on expressions

See also forum thread: https://forum.freecadweb.org/viewtopic.php?f=3&t=74331
This commit is contained in:
wmayer
2023-01-02 16:36:10 +01:00
parent d60f2e291f
commit 9efac962ac
2 changed files with 7 additions and 1 deletions

View File

@@ -1632,6 +1632,12 @@ class DocumentExpressionCases(unittest.TestCase):
FreeCAD.closeDocument(self.Doc.Name)
self.Doc = FreeCAD.openDocument(SaveName)
def testCyclicDependencyOnPlacement(self):
obj = self.Doc.addObject("App::FeaturePython","Python")
obj.addProperty("App::PropertyPlacement", "Placement")
obj.setExpression('.Placement.Base.x', '.Placement.Base.y + 10mm')
with self.assertRaises(RuntimeError):
obj.setExpression('.Placement.Base.y', '.Placement.Base.x + 10mm')
def tearDown(self):
#closing doc