Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sergo authored and wwmayer committed Mar 18, 2017
1 parent 02166ed commit dd9c27d
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions src/Mod/PartDesign/TestPartDesignApp.py
Expand Up @@ -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
#---------------------------------------------------------------------------
Expand All @@ -43,47 +42,47 @@ def testBoxCase(self):
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")

0 comments on commit dd9c27d

Please sign in to comment.