diff --git a/sandbox_fs_test.py b/sandbox_fs_test.py index 8b97b98..884ad81 100755 --- a/sandbox_fs_test.py +++ b/sandbox_fs_test.py @@ -11,6 +11,7 @@ import unittest tempfile.tempdir = os.getcwd() # This tests fails when using /tmp. +VIGIL_ROOT = os.path.dirname(__file__) def _get_test_paths(temp_dir): @@ -26,7 +27,8 @@ class SandboxFilesystemTestCase(unittest.TestCase): with tempfile.TemporaryDirectory() as temp_dir: a_dir, foo_path, bar_path = _get_test_paths(temp_dir) os.mkdir(a_dir) - subprocess.check_call(["./sandbox_fs", a_dir, "--", __file__, + sandbox_fs_path = os.path.join(VIGIL_ROOT, "sandbox_fs") + subprocess.check_call([sandbox_fs_path, a_dir, "--", __file__, temp_dir]) self.assertTrue(os.path.exists(foo_path)) self.assertFalse(os.path.exists(bar_path)) diff --git a/tools_test.py b/tools_test.py index 9746c86..3bf0437 100755 --- a/tools_test.py +++ b/tools_test.py @@ -41,7 +41,7 @@ def result_path(tool, input_filename): def run_tool(tool, input_filename): - with chdir("golden-files"): + with chdir(os.path.join(VIGIL_ROOT, "golden-files")): return tool(os.path.join(".", "input", input_filename))