Skip to content
Snippets Groups Projects
Commit f293dd4b authored by Hans Fangohr's avatar Hans Fangohr
Browse files

move tests that do not need file system out of chdir context

parent 8e01364f
No related branches found
No related tags found
2 merge requests!19Move linux-debian11 into main,!14Draft: Add tests for run method
......@@ -26,10 +26,13 @@ def test_os_chdir(tmp_path):
def test_run_method(tmp_path):
run = mod.run
# test a command with options:
assert run(["date", "+%Y-%m-%d"]).returncode == 0
assert run("date +%Y-%m-%d", shell=True).returncode == 0
with mod.os_chdir(str(tmp_path)):
run = mod.run
# test a command with options:
assert run(["date", "+%Y-%m-%d"], shell=True).returncode == 0
# ensure single string command works
assert run(("ls -l")).returncode == 0
# test spaces are handled correctly:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment