Skip to content

Commit

Permalink
fix unit test to work on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Jericho Tolentino <[email protected]>
  • Loading branch information
jericht committed Sep 21, 2023
1 parent f9ccee7 commit c9791b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/unit/deadline/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def test_start(
caplog.set_level("INFO")

# file_mappings
tmpdir = "/tmp"
tmpdir = os.path.join(os.sep, "tmp")

# subprocess.Popen("./run_container.sh")
run_container_stdout_lines = ["line1", "line2", ""]
Expand Down Expand Up @@ -409,12 +409,12 @@ def test_start(
mock_shutil.copytree.assert_called_once_with(ANY, tmpdir, dirs_exist_ok=True)

# Verify file_mappings dir is staged
file_mappings_dir = f"{tmpdir}/file_mappings"
file_mappings_dir = os.path.join(tmpdir, "file_mappings")
mock_makedirs.assert_called_once_with(file_mappings_dir)
assert worker_config.file_mappings
for src, _ in worker_config.file_mappings:
mock_shutil.copyfile.assert_any_call(
src, f"{file_mappings_dir}/{os.path.basename(src)}"
src, os.path.join(file_mappings_dir, os.path.basename(src))
)

# Verify subprocess.Popen("./run_container.sh")
Expand Down

0 comments on commit c9791b5

Please sign in to comment.