Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f613a91
commit eb00977
Showing
5 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ INSTALL( | |
FILES | ||
Init.py | ||
InitGui.py | ||
TestTechDrawApp.py | ||
DESTINATION | ||
Mod/TechDraw | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Copyright (c) 2015 WandererFan <wandererfan@gmail.com> * | ||
# * | ||
# This file is part of the FreeCAD CAx development system. * | ||
# * | ||
# This program is free software; you can redistribute it and/or modify * | ||
# it under the terms of the GNU Lesser General Public License (LGPL) * | ||
# as published by the Free Software Foundation; either version 2 of * | ||
# the License, or (at your option) any later version. * | ||
# for detail see the LICENCE text file. * | ||
# * | ||
# FreeCAD is distributed in the hope that it will be useful, * | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
# GNU Library General Public License for more details. * | ||
# * | ||
# You should have received a copy of the GNU Library General Public * | ||
# License along with FreeCAD; if not, write to the Free Software * | ||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * | ||
# USA * | ||
#************************************************************************** | ||
|
||
import FreeCAD, os, sys, unittest, Part | ||
import Measure | ||
import TechDraw | ||
import time | ||
App = FreeCAD | ||
|
||
#--------------------------------------------------------------------------- | ||
# define the test cases to test the FreeCAD TechDraw module | ||
#--------------------------------------------------------------------------- | ||
|
||
|
||
class TechDrawTestCases(unittest.TestCase): | ||
def setUp(self): | ||
self.Doc = FreeCAD.newDocument("TechDrawTest") | ||
|
||
def testPageCase(self): | ||
self.templateFileSpec = App.getResourceDir() + 'Mod/TechDraw/Templates/A4_LandscapeTD.svg' | ||
self.Box = self.Doc.addObject("Part::Box","Box") | ||
self.Page = self.Doc.addObject('TechDraw::DrawPage','Page') | ||
self.Template = self.Doc.addObject('TechDraw::DrawSVGTemplate','Template') | ||
self.Template.Template = self.templateFileSpec | ||
self.Page.Template = self.Template | ||
self.View = self.Doc.addObject('TechDraw::DrawViewPart','View') | ||
rc = self.Page.addView(self.View) | ||
self.View.Source = self.Box | ||
self.Anno = self.Doc.addObject('TechDraw::DrawViewAnnotation','TestAnno') | ||
rc = self.Page.addView(self.Anno) | ||
self.Sect = self.Doc.addObject('TechDraw::DrawViewSection','Section') | ||
rc = self.Page.addView(self.Sect) | ||
self.Sect.SectionOrigin = (1.0,1.0,1.0) | ||
self.Sect.Source = self.Box | ||
self.Doc.recompute() | ||
self.failUnless(len(self.Page.Views) == 3) | ||
|
||
def tearDown(self): | ||
#closing doc | ||
FreeCAD.closeDocument("TechDrawTest") | ||
#print ("omit clos document for debuging") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters