Removed placeholder raise statement.
This commit is contained in:
parent
f76139e72c
commit
5ad9cd9b94
|
@ -40,7 +40,7 @@ def importShape(importType,fileName):
|
|||
|
||||
#Check to see what type of file we're working with
|
||||
if importType == ImportTypes.STEP:
|
||||
raise RuntimeError("Failed on purpose.")
|
||||
importStep(fileName)
|
||||
|
||||
#Loads a STEP file into a CQ object
|
||||
def importStep(self,fileName):
|
||||
|
|
|
@ -18,28 +18,29 @@ else:
|
|||
|
||||
class TestImporters(BaseTest):
|
||||
|
||||
def importBox(importType,fileName):
|
||||
def importBox(self, importType,fileName):
|
||||
"""
|
||||
Exports a simple box to a STEP file and then imports it again
|
||||
:param importType: The type of file we're importing (STEP, STL, etc)
|
||||
:param fileName: The path and name of the file to write to
|
||||
"""
|
||||
#We're importing a STEP file
|
||||
if importType == ImportTypes.STEP:
|
||||
if importType == importers.ImportTypes.STEP:
|
||||
#We first need to build a simple shape to export
|
||||
shape = Workplane("XY").box(1,2,3).val
|
||||
shape = Workplane("XY").box(1,2,3).val()
|
||||
|
||||
#Export the shape to a temporary file
|
||||
shape.exportStep(fileName)
|
||||
|
||||
# Reimport the shape from the new STEP file
|
||||
importedShape = importShape(importType,fileName)
|
||||
importedShape = importers.importShape(importType,fileName)
|
||||
|
||||
def testSTEP(self):
|
||||
"""
|
||||
Tests STEP file import
|
||||
"""
|
||||
importBox(ImportTypes.STEP, OUTDIR + "/tempSTEP.step")
|
||||
self.importBox(importers.ImportTypes.STEP, OUTDIR + "/tempSTEP.step")
|
||||
|
||||
if __name__ == '__main__':
|
||||
testSTEP()
|
||||
import unittest
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in New Issue
Block a user