Merged jpcgt/flatcam into master

This commit is contained in:
Kamil Sopko
2016-03-10 22:21:58 +01:00

View File

@@ -6,7 +6,7 @@ from FlatCAMObj import FlatCAMGerber, FlatCAMGeometry, FlatCAMCNCjob
from ObjectUI import GerberObjectUI, GeometryObjectUI from ObjectUI import GerberObjectUI, GeometryObjectUI
from time import sleep from time import sleep
import os import os
import tempfile
class GerberFlowTestCase(unittest.TestCase): class GerberFlowTestCase(unittest.TestCase):
@@ -128,7 +128,10 @@ class GerberFlowTestCase(unittest.TestCase):
# Export G-Code, check output # Export G-Code, check output
#----------------------------------------- #-----------------------------------------
assert isinstance(cnc_obj, FlatCAMCNCjob) 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) cnc_obj.export_gcode(output_filename)
self.assertTrue(os.path.isfile(output_filename)) self.assertTrue(os.path.isfile(output_filename))
os.remove(output_filename) os.remove(output_filename)