From ccde95be873e39eb507de4fcdaa2145e08548295 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Wed, 11 Oct 2023 14:04:02 +0200 Subject: [PATCH] tests: make relocation test not require symlinked directory in the source tree. --- tests/reloc/dir1/foo | 0 tests/reloc/dir2 | 1 - tests/test_relocate.py | 12 +++++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) delete mode 100644 tests/reloc/dir1/foo delete mode 120000 tests/reloc/dir2 diff --git a/tests/reloc/dir1/foo b/tests/reloc/dir1/foo deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/reloc/dir2 b/tests/reloc/dir2 deleted file mode 120000 index df490f837a..0000000000 --- a/tests/reloc/dir2 +++ /dev/null @@ -1 +0,0 @@ -dir1 \ No newline at end of file diff --git a/tests/test_relocate.py b/tests/test_relocate.py index e3c7e59c86..81877c7766 100644 --- a/tests/test_relocate.py +++ b/tests/test_relocate.py @@ -1,4 +1,6 @@ import json +import os +import shutil import sys from pathlib import Path @@ -56,15 +58,19 @@ def test_for_conflict_file_names_nodocker(tmp_path: Path) -> None: def test_relocate_symlinks(tmp_path: Path) -> None: + shutil.copy(get_data("tests/reloc/test.cwl"), tmp_path) + (tmp_path / "dir1").mkdir() + (tmp_path / "dir1" / "foo").touch() + os.symlink(tmp_path / "dir1", tmp_path / "dir2") assert ( main( [ "--debug", "--outdir", - get_data("tests/reloc") + "/dir2", - get_data("tests/reloc/test.cwl"), + str(tmp_path / "dir2"), + str(tmp_path / "test.cwl"), "--inp", - get_data("tests/reloc") + "/dir2", + str(tmp_path / "dir2"), ] ) == 0