6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-11-16 18:15:09 +00:00
tutor/tests/test_scripts.py

21 lines
635 B
Python
Raw Normal View History

2019-05-11 18:41:04 +00:00
import unittest
import unittest.mock
from tutor.commands.config import load_defaults
2019-05-11 18:41:04 +00:00
from tutor import env
from tutor import scripts
class ScriptsTests(unittest.TestCase):
def test_run_script(self):
config = {}
load_defaults(config)
rendered_script = env.render_file(config, "scripts", "create_databases.sh")
2019-05-11 18:41:04 +00:00
with unittest.mock.Mock() as run_func:
scripts.run_script(
"/tmp", config, "someservice", "create_databases.sh", run_func
)
run_func.assert_called_once_with(
"/tmp", config, "someservice", rendered_script
)