Skip to content

Commit

Permalink
fix run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
keurfonluu committed Aug 14, 2023
1 parent 72e4be7 commit 6db5c81
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/test_run.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import os
import platform

import pytest

import toughio
Expand All @@ -13,15 +16,15 @@
None,
"docker-image",
False,
'docker run --rm -v "%cd%":/shared -w /shared docker-image tough-exec INFILE INFILE.out',
"docker run --rm -v PLACEHOLDER:/shared -w /shared docker-image tough-exec INFILE INFILE.out",
),
("tough-exec", None, None, True, 'bash -c "tough-exec INFILE INFILE.out"'),
(
"tough-exec",
8,
"docker-image",
True,
'bash -c "docker run --rm -v "%cd%":/shared -w /shared docker-image mpiexec -n 8 tough-exec INFILE INFILE.out"',
'bash -c "docker run --rm -v PLACEHOLDER:/shared -w /shared docker-image mpiexec -n 8 tough-exec INFILE INFILE.out"',
),
],
)
Expand All @@ -36,4 +39,10 @@ def test_run(exec, workers, docker, wsl, cmd):
silent=True,
)

if platform.system().startswith("Win") and os.getenv("ComSpec").endswith("cmd.exe"):
cmd = cmd.replace("PLACEHOLDER", '"%cd%"')

else:
cmd = cmd.replace("PLACEHOLDER", "${PWD}")

assert status.args == cmd

0 comments on commit 6db5c81

Please sign in to comment.