Skip to content
Snippets Groups Projects

Draft: Add tests for run method

Merged Ashwin Kumar Karnad requested to merge run-tests-for-run into linux-debian11
1 file
+ 3
0
Compare changes
  • Side-by-side
  • Inline
+ 3
0
@@ -26,12 +26,15 @@ def test_os_chdir(tmp_path):
def test_run_method(tmp_path):
"""Run tests for run method."""
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
# tests interacting with the file system
with mod.os_chdir(str(tmp_path)):
# ensure single string command works
assert run(("ls -l"), shell=True).returncode == 0
Loading