Update test_cadquery.py

Changed directory to point to test data.
This commit is contained in:
cactrot
2020-09-24 13:29:59 -04:00
committed by GitHub
parent 62c287a62e
commit 26de7bc9c2

View File

@ -24,6 +24,9 @@ from tests import (
makeCube, makeCube,
) )
# test data directory
testdataDir = os.path.join(os.path.dirname(__file__), "testdata")
# where unit test output will be saved # where unit test output will be saved
OUTDIR = tempfile.gettempdir() OUTDIR = tempfile.gettempdir()
SUMMARY_FILE = os.path.join(OUTDIR, "testSummary.html") SUMMARY_FILE = os.path.join(OUTDIR, "testSummary.html")
@ -2699,7 +2702,7 @@ class TestCadQuery(BaseTest):
self.assertAlmostEqual(obj1.val().Volume(), obj2.val().Volume()) self.assertAlmostEqual(obj1.val().Volume(), obj2.val().Volume())
def testText(self): def testText(self):
global OUTDIR global testdataDir
box = Workplane("XY").box(4, 4, 0.5) box = Workplane("XY").box(4, 4, 0.5)
@ -2757,7 +2760,7 @@ class TestCadQuery(BaseTest):
"CQ 2.0", "CQ 2.0",
0.5, 0.5,
0.05, 0.05,
fontPath=os.path.join(OUTDIR, "Sans.ttf"), fontPath=os.path.join(testdataDir, "OpenSans-Regular.ttf"),
cut=False, cut=False,
combine=False, combine=False,
halign="right", halign="right",