OpenSCAD: [skip ci] fix incorrect filename creation in unit tests
This commit is contained in:
@@ -74,7 +74,7 @@ class TestImportCSG(unittest.TestCase):
|
||||
|
||||
def test_import_sphere(self):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
filename = temp_dir + os.pathsep + "sphere.scad"
|
||||
filename = temp_dir + os.path.sep + "sphere.scad"
|
||||
f = open(filename,"w+")
|
||||
f.write("sphere(10.0);")
|
||||
f.close()
|
||||
@@ -86,7 +86,7 @@ class TestImportCSG(unittest.TestCase):
|
||||
|
||||
def test_import_cylinder(self):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
filename = temp_dir + os.pathsep + "cylinder.scad"
|
||||
filename = temp_dir + os.path.sep + "cylinder.scad"
|
||||
f = open(filename,"w+")
|
||||
f.write("cylinder(50.0,d=10.0);")
|
||||
f.close()
|
||||
@@ -99,7 +99,7 @@ class TestImportCSG(unittest.TestCase):
|
||||
|
||||
def test_import_cube(self):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
filename = temp_dir + os.pathsep + "cube.scad"
|
||||
filename = temp_dir + os.path.sep + "cube.scad"
|
||||
f = open(filename,"w+")
|
||||
f.write("cube([1.0,2.0,3.0]);")
|
||||
f.close()
|
||||
@@ -113,7 +113,7 @@ class TestImportCSG(unittest.TestCase):
|
||||
|
||||
def test_import_circle(self):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
filename = temp_dir + os.pathsep + "circle.scad"
|
||||
filename = temp_dir + os.path.sep + "circle.scad"
|
||||
f = open(filename,"w+")
|
||||
f.write("circle(10.0);")
|
||||
f.close()
|
||||
@@ -125,7 +125,7 @@ class TestImportCSG(unittest.TestCase):
|
||||
|
||||
def test_import_square(self):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
filename = temp_dir + os.pathsep + "square.scad"
|
||||
filename = temp_dir + os.path.sep + "square.scad"
|
||||
f = open(filename,"w+")
|
||||
f.write("square([1.0,2.0]);")
|
||||
f.close()
|
||||
@@ -138,7 +138,7 @@ class TestImportCSG(unittest.TestCase):
|
||||
|
||||
def test_import_text(self):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
filename = temp_dir + os.pathsep + "text.scad"
|
||||
filename = temp_dir + os.path.sep + "text.scad"
|
||||
f = open(filename,"w+")
|
||||
f.write("text(\"X\");") # Keep it short to keep the test fast-ish
|
||||
f.close()
|
||||
@@ -152,7 +152,7 @@ class TestImportCSG(unittest.TestCase):
|
||||
|
||||
def test_import_polygon_nopath(self):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
filename = temp_dir + os.pathsep + "polygon_nopath.scad"
|
||||
filename = temp_dir + os.path.sep + "polygon_nopath.scad"
|
||||
f = open(filename,"w+")
|
||||
f.write("polygon(points=[[0,0],[100,0],[130,50],[30,50]]);")
|
||||
f.close()
|
||||
@@ -164,7 +164,7 @@ class TestImportCSG(unittest.TestCase):
|
||||
|
||||
def test_import_polygon_path(self):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
filename = temp_dir + os.pathsep + "polygon_path.scad"
|
||||
filename = temp_dir + os.path.sep + "polygon_path.scad"
|
||||
f = open(filename,"w+")
|
||||
f.write("polygon([[0,0],[100,0],[130,50],[30,50]], paths=[[0,1,2,3]]);")
|
||||
f.close()
|
||||
@@ -176,7 +176,7 @@ class TestImportCSG(unittest.TestCase):
|
||||
|
||||
def test_import_polyhedron(self):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
filename = temp_dir + os.pathsep + "polyhedron.scad"
|
||||
filename = temp_dir + os.path.sep + "polyhedron.scad"
|
||||
f = open(filename,"w+")
|
||||
f.write(
|
||||
"""
|
||||
@@ -197,7 +197,7 @@ polyhedron(
|
||||
|
||||
def utility_create_scad(self, scadCode, name):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
filename = temp_dir + os.pathsep + name + ".scad"
|
||||
filename = temp_dir + os.path.sep + name + ".scad"
|
||||
f = open(filename,"w+")
|
||||
f.write(scadCode)
|
||||
f.close()
|
||||
|
||||
Reference in New Issue
Block a user