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
+ 6
3
Compare changes
  • Side-by-side
  • Inline
+ 6
3
@@ -26,10 +26,13 @@ def test_os_chdir(tmp_path):
@@ -26,10 +26,13 @@ def test_os_chdir(tmp_path):
def test_run_method(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)):
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
# ensure single string command works
assert run(("ls -l")).returncode == 0
assert run(("ls -l")).returncode == 0
# test spaces are handled correctly:
# test spaces are handled correctly:
Loading