From c9791b5bdd923afca984d4359cb63552db59d4e3 Mon Sep 17 00:00:00 2001 From: Jericho Tolentino <68654047+jericht@users.noreply.github.com> Date: Wed, 20 Sep 2023 22:01:14 +0000 Subject: [PATCH] fix unit test to work on windows Signed-off-by: Jericho Tolentino <68654047+jericht@users.noreply.github.com> --- test/unit/deadline/test_worker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/deadline/test_worker.py b/test/unit/deadline/test_worker.py index 6114593..87b4022 100644 --- a/test/unit/deadline/test_worker.py +++ b/test/unit/deadline/test_worker.py @@ -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", ""] @@ -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")