Skip to content

Commit

Permalink
Add symlink test for local checkout of cable
Browse files Browse the repository at this point in the history
  • Loading branch information
abhaasgoyal committed Mar 4, 2024
1 parent 6731ec0 commit 17c6214
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/test_workdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,25 @@ def revision_log_file(self) -> Path:
def pbs_job_file(self, request) -> Path:
return Path(request.param)

def test_clean_realisation_files(self, src_path, revision_log_file):
"""Success case: directory tree does not exist after clean."""
def test_clean_realisation_files(
self, src_path: Path, tmp_path: Path, revision_log_file: Path
):
"""Success case: Realisation files created by benchcab are removed after clean."""
src_path.mkdir()
cable_symlink = src_path / "main"
# tmp_path contains the path being symlinked
local_cable_src_path = tmp_path / "CABLE"
local_cable_src_path.mkdir()
cable_symlink.symlink_to(local_cable_src_path)
revision_log_file.touch()
clean_realisation_files()

assert local_cable_src_path.exists()
assert not src_path.exists()
assert not revision_log_file.exists()

def test_clean_submission_files(self, runs_path, pbs_job_file):
"""Success case: log files in project root directory do not exist after clean."""
"""Success case: Submission files created by benchcab are removed after clean."""
runs_path.mkdir()
pbs_job_file.touch()
clean_submission_files()
Expand Down

0 comments on commit 17c6214

Please sign in to comment.