fix tests

This commit is contained in:
sergo
2017-03-17 13:38:26 -04:00
committed by wmayer
parent 02166ed4be
commit dd9c27d4ae

View File

@@ -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")
FreeCAD.closeDocument("PartDesignTest")
# print ("omit closing document for debugging")