diff options
Diffstat (limited to 'yaksh/evaluator_tests/test_grader_evaluation.py')
-rw-r--r-- | yaksh/evaluator_tests/test_grader_evaluation.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/yaksh/evaluator_tests/test_grader_evaluation.py b/yaksh/evaluator_tests/test_grader_evaluation.py new file mode 100644 index 0000000..d11f4a0 --- /dev/null +++ b/yaksh/evaluator_tests/test_grader_evaluation.py @@ -0,0 +1,42 @@ +from __future__ import unicode_literals +import unittest +import os +from yaksh import python_assertion_evaluator +from yaksh.language_registry import _LanguageRegistry, get_registry +from yaksh.settings import SERVER_TIMEOUT, code_evaluators + + +class RegistryTestCase(unittest.TestCase): + def setUp(self): + self.registry_object = get_registry() + self.language_registry = _LanguageRegistry() + assertion_evaluator_path = ("yaksh.python_assertion_evaluator" + ".PythonAssertionEvaluator" + ) + stdio_evaluator_path = ("yaksh.python_stdio_evaluator." + "PythonStdIOEvaluator" + ) + + hook_evaluator_path = ("yaksh.hook_evaluator." + "HookEvaluator" + ) + code_evaluators['python'] = \ + {"standardtestcase": assertion_evaluator_path, + "stdiobasedtestcase": stdio_evaluator_path, + "hooktestcase": hook_evaluator_path + } + + def test_set_register(self): + evaluator_class = self.registry_object.get_class("python", + "standardtestcase" + ) + class_name = getattr(python_assertion_evaluator, + 'PythonAssertionEvaluator' + ) + self.assertEqual(evaluator_class, class_name) + + def tearDown(self): + self.registry_object = None + +if __name__ == '__main__': + unittest.main() |