2021-11-23 08:25:09 +00:00
|
|
|
import os
|
|
|
|
import unittest
|
|
|
|
|
2022-10-19 15:46:31 +00:00
|
|
|
from tests.helpers import TestContext, TestTaskRunner, temporary_root
|
2021-11-23 08:25:09 +00:00
|
|
|
from tutor import config as tutor_config
|
|
|
|
|
|
|
|
|
|
|
|
class TestContextTests(unittest.TestCase):
|
|
|
|
def test_create_testcontext(self) -> None:
|
|
|
|
with temporary_root() as root:
|
|
|
|
context = TestContext(root)
|
|
|
|
config = tutor_config.load_full(root)
|
|
|
|
runner = context.job_runner(config)
|
|
|
|
self.assertTrue(os.path.exists(context.root))
|
|
|
|
self.assertFalse(
|
|
|
|
os.path.exists(os.path.join(context.root, tutor_config.CONFIG_FILENAME))
|
|
|
|
)
|
2022-10-19 15:46:31 +00:00
|
|
|
self.assertTrue(isinstance(runner, TestTaskRunner))
|