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, Part 00023 App = FreeCAD 00024 00025 #--------------------------------------------------------------------------- 00026 # define the test cases to test the FreeCAD Part module 00027 #--------------------------------------------------------------------------- 00028 00029 00030 class PartTestCases(unittest.TestCase): 00031 def setUp(self): 00032 self.Doc = FreeCAD.newDocument("PartTest") 00033 00034 def testBoxCase(self): 00035 self.Box = App.ActiveDocument.addObject("Part::Box","Box") 00036 self.Doc.recompute() 00037 self.failUnless(len(self.Box.Shape.Faces)==6) 00038 00039 def tearDown(self): 00040 #closing doc 00041 FreeCAD.closeDocument("PartTest") 00042 #print ("omit clos document for debuging")