blob: e4f129c9b477848fd7cf1a0ecb59fdc5293330b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
import unittest
import os
from yaksh import python_assertion_evaluator
from yaksh.language_registry import _LanguageRegistry, get_registry
from yaksh.settings import SERVER_TIMEOUT
class RegistryTestCase(unittest.TestCase):
def setUp(self):
self.registry_object = get_registry()
self.language_registry = _LanguageRegistry()
def test_set_register(self):
class_name = getattr(python_assertion_evaluator, 'PythonAssertionEvaluator')
self.registry_object.register("python", {"standardtestcase": "yaksh.python_assertion_evaluator.PythonAssertionEvaluator",
"stdoutbasedtestcase": "python_stdout_evaluator.PythonStdoutEvaluator"
})
self.assertEquals(self.registry_object.get_class("python", "standardtestcase"), class_name)
def tearDown(self):
self.registry_object = None
if __name__ == '__main__':
unittest.main()
# import unittest
# import os
# from yaksh import cpp_code_evaluator
# from yaksh.language_registry import _LanguageRegistry, get_registry
# from yaksh.settings import SERVER_TIMEOUT
# class RegistryTestCase(unittest.TestCase):
# def setUp(self):
# self.registry_object = get_registry()
# self.language_registry = _LanguageRegistry()
# def test_set_register(self):
# class_name = getattr(cpp_code_evaluator, 'CppCodeEvaluator')
# self.registry_object.register("c", {"standardtestcase": "cpp_code_evaluator.CppCodeEvaluator"})
# self.assertEquals(self.registry_object.get_class("c", "standardtestcase"), class_name)
# def tearDown(self):
# self.registry_object = None
# if __name__ == '__main__':
# unittest.main()
|