1
0
Fork 0
mirror of https://github.com/YunoHost/moulinette.git synced 2024-09-03 20:06:31 +02:00
moulinette/test/test_process.py
2019-11-25 17:21:13 +01:00

17 lines
412 B
Python

import os
from subprocess import CalledProcessError
import pytest
from moulinette.utils.process import run_commands
def test_run_shell_command_list(test_file):
assert os.path.exists(str(test_file))
run_commands(["rm -f %s" % str(test_file)])
assert not os.path.exists(str(test_file))
def test_run_shell_bad_cmd():
with pytest.raises(CalledProcessError):
run_commands(["yolo swag"])