00001 # (c) Juergen Riegel (FreeCAD@juergen-riegel.net) 2011 LGPL * 00002 # * 00003 # This file is part of the FreeCAD CAx development system. * 00004 # * 00005 # This program is free software; you can redistribute it and/or modify * 00006 # it under the terms of the GNU Lesser General Public License (LGPL) * 00007 # as published by the Free Software Foundation; either version 2 of * 00008 # the License, or (at your option) any later version. * 00009 # for detail see the LICENCE text file. * 00010 # * 00011 # FreeCAD is distributed in the hope that it will be useful, * 00012 # but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00014 # GNU Library General Public License for more details. * 00015 # * 00016 # You should have received a copy of the GNU Library General Public * 00017 # License along with FreeCAD; if not, write to the Free Software * 00018 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 00019 # USA * 00020 #************************************************************************** 00021 00022 import FreeCAD, os, sys, unittest, Sketcher, PartDesign, TestSketcherApp 00023 App = FreeCAD 00024 00025 #--------------------------------------------------------------------------- 00026 # define the test cases to test the FreeCAD Sketcher module 00027 #--------------------------------------------------------------------------- 00028 00029 00030 class PartDesignPadTestCases(unittest.TestCase): 00031 def setUp(self): 00032 self.Doc = FreeCAD.newDocument("PartDesignTest") 00033 00034 def testBoxCase(self): 00035 self.PadSketch = self.Doc.addObject('Sketcher::SketchObject','SketchPad') 00036 TestSketcherApp.CreateSlotPlateSet(self.PadSketch) 00037 self.Doc.recompute() 00038 self.Pad = self.Doc.addObject("PartDesign::Pad","Pad") 00039 self.Pad.Sketch = self.PadSketch 00040 self.Doc.recompute() 00041 self.failUnless(len(self.Pad.Shape.Faces) == 6) 00042 00043 def tearDown(self): 00044 #closing doc 00045 FreeCAD.closeDocument("PartDesignTest") 00046 #print ("omit clos document for debuging")