From cd2da9fe6d3f18da685d0243e4317ef4557edcaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Tr=C3=B6ger?= Date: Tue, 12 Apr 2016 17:35:04 +0200 Subject: [PATCH] Fix test cases by adopting to new behavior Pad now does not have a Sketch property anymore but a profile property. Also due to changes in PropertyLinkSubList it ispossible that PropertyLinks get an empty list assigned, this must be supportet now. --- src/App/PropertyLinks.cpp | 4 +++- src/Mod/PartDesign/TestPartDesignApp.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index 88652a7c2..5e00cdbb3 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -249,7 +249,9 @@ void PropertyLinkSub::setPyObject(PyObject *value) } else if (PyTuple_Check(value) || PyList_Check(value)) { Py::Sequence seq(value); - if (PyObject_TypeCheck(seq[0].ptr(), &(DocumentObjectPy::Type))){ + if(seq.size() == 0) + setValue(NULL); + else if (PyObject_TypeCheck(seq[0].ptr(), &(DocumentObjectPy::Type))){ DocumentObjectPy *pcObj = (DocumentObjectPy*)seq[0].ptr(); if (seq[1].isString()) { std::vector vals; diff --git a/src/Mod/PartDesign/TestPartDesignApp.py b/src/Mod/PartDesign/TestPartDesignApp.py index ec97a09fd..d90c2cd92 100644 --- a/src/Mod/PartDesign/TestPartDesignApp.py +++ b/src/Mod/PartDesign/TestPartDesignApp.py @@ -36,7 +36,7 @@ class PartDesignPadTestCases(unittest.TestCase): TestSketcherApp.CreateSlotPlateSet(self.PadSketch) self.Doc.recompute() self.Pad = self.Doc.addObject("PartDesign::Pad","Pad") - self.Pad.Sketch = self.PadSketch + self.Pad.Profile = self.PadSketch self.Doc.recompute() self.failUnless(len(self.Pad.Shape.Faces) == 6)