6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-09-28 20:29:02 +00:00
tutor/tests/test_scripts.py
2019-06-07 22:49:45 +02:00

19 lines
540 B
Python

import unittest
import unittest.mock
from tutor import config as tutor_config
from tutor import scripts
class DummyRunner(scripts.BaseRunner):
exec = unittest.mock.Mock()
class ScriptsTests(unittest.TestCase):
def test_run(self):
config = tutor_config.load_defaults()
runner = DummyRunner("/tmp", config)
rendered_script = runner.render("mysql-client", "createdatabases")
runner.run("mysql-client", "createdatabases")
runner.exec.assert_called_once_with("mysql-client", rendered_script)