From dd9c27d4ae7bcfb82ed77c16cd5c1877f0230e97 Mon Sep 17 00:00:00 2001 From: sergo Date: Fri, 17 Mar 2017 13:38:26 -0400 Subject: [PATCH] fix tests --- src/Mod/PartDesign/TestPartDesignApp.py | 41 ++++++++++++------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/Mod/PartDesign/TestPartDesignApp.py b/src/Mod/PartDesign/TestPartDesignApp.py index c48d64bf95..15e5080173 100644 --- a/src/Mod/PartDesign/TestPartDesignApp.py +++ b/src/Mod/PartDesign/TestPartDesignApp.py @@ -19,9 +19,8 @@ # USA * #************************************************************************** -import FreeCAD, FreeCADGui, os, sys, unittest, Sketcher, PartDesign, TestSketcherApp +import FreeCAD, os, sys, unittest, Sketcher, PartDesign, TestSketcherApp App = FreeCAD -Gui = FreeCADGui #--------------------------------------------------------------------------- # define the test cases to test the FreeCAD Sketcher module #--------------------------------------------------------------------------- @@ -43,47 +42,47 @@ class PartDesignPadTestCases(unittest.TestCase): def tearDown(self): #closing doc FreeCAD.closeDocument("PartDesignTest") - #print ("omit clos document for debuging") + # print ("omit clos document for debuging") class PartDesignRevolveTestCases(unittest.TestCase): def setUp(self): self.Doc = FreeCAD.newDocument("PartDesignTest") def testRevolveFace(self): - self.Body1 = self.Doc.addObject('PartDesign::Body','Body') - self.Box1 = self.Doc.addObject('PartDesign::AdditiveBox','Box') - self.Body1.addObject(self.Box1) - self.Box1.Length=10.00 - self.Box1.Width=10.00 - self.Box1.Height=10.00 + self.Body = self.Doc.addObject('PartDesign::Body','Body') + self.Box = self.Doc.addObject('PartDesign::AdditiveBox','Box') + self.Body.addObject(self.Box) + self.Box.Length=10.00 + self.Box.Width=10.00 + self.Box.Height=10.00 self.Doc.recompute() self.Revolution = self.Doc.addObject("PartDesign::Revolution","Revolution") - self.Revolution.Profile = (self.Box1, ["Face6"]) + self.Revolution.Profile = (self.Box, ["Face6"]) self.Revolution.ReferenceAxis = (self.Doc.Y_Axis,[""]) self.Revolution.Angle = 180.0 self.Revolution.Reversed = 1 - self.Body1.addObject(self.Revolution) + self.Body.addObject(self.Revolution) self.Doc.recompute() self.failUnless(len(self.Revolution.Shape.Faces) == 10) def testGrooveFace(self): - self.Body2 = self.Doc.addObject('PartDesign::Body','Body') - self.Box2 = self.Doc.addObject('PartDesign::AdditiveBox','Box') - self.Body2.addObject(self.Box2) - self.Box2.Length=10.00 - self.Box2.Width=10.00 - self.Box2.Height=10.00 + self.Body = self.Doc.addObject('PartDesign::Body','Body') + self.Box = self.Doc.addObject('PartDesign::AdditiveBox','Box') + self.Body.addObject(self.Box) + self.Box.Length=10.00 + self.Box.Width=10.00 + self.Box.Height=10.00 self.Doc.recompute() self.Groove = self.Doc.addObject("PartDesign::Groove","Groove") - self.Groove.Profile = (self.Box2, ["Face6"]) + self.Groove.Profile = (self.Box, ["Face6"]) self.Groove.ReferenceAxis = (self.Doc.X_Axis,[""]) self.Groove.Angle = 180.0 self.Groove.Reversed = 1 - self.Body2.addObject(self.Groove) + self.Body.addObject(self.Groove) self.Doc.recompute() self.failUnless(len(self.Groove.Shape.Faces) == 5) def tearDown(self): #closing doc - # FreeCAD.closeDocument("PartDesignTest") - print ("omit closing document for debugging") \ No newline at end of file + FreeCAD.closeDocument("PartDesignTest") + # print ("omit closing document for debugging") \ No newline at end of file