Merged jpcgt/flatcam/master into tcl-errors

This commit is contained in:
Kamil Sopko 2016-03-10 22:23:01 +01:00
commit e2eb5f293a
1 changed files with 5 additions and 2 deletions

View File

@ -6,7 +6,7 @@ from FlatCAMObj import FlatCAMGerber, FlatCAMGeometry, FlatCAMCNCjob
from ObjectUI import GerberObjectUI, GeometryObjectUI
from time import sleep
import os
import tempfile
class GerberFlowTestCase(unittest.TestCase):
@ -128,7 +128,10 @@ class GerberFlowTestCase(unittest.TestCase):
# Export G-Code, check output
#-----------------------------------------
assert isinstance(cnc_obj, FlatCAMCNCjob)
output_filename = "tests/tmp/" + cnc_name + ".gcode"
output_filename = ""
# get system temporary file(try create it and delete also)
with tempfile.NamedTemporaryFile(prefix='unittest.', suffix="." + cnc_name + '.gcode', delete=True) as tmp_file:
output_filename = tmp_file.name
cnc_obj.export_gcode(output_filename)
self.assertTrue(os.path.isfile(output_filename))
os.remove(output_filename)