diff options
author | Prabhu Ramachandran | 2016-12-23 13:40:44 +0530 |
---|---|---|
committer | GitHub | 2016-12-23 13:40:44 +0530 |
commit | 48366e84b98157ac32b22b2aa19b1c1cde68afd4 (patch) | |
tree | adb07f2709621b8906b5047da02010958bebba67 /yaksh/evaluator_tests/test_scilab_evaluation.py | |
parent | 77e8a6c1cde9190daf9075d71caf6017dc1380e7 (diff) | |
parent | 0e56fc6a77ec21db05c9bafb42b1acc652354a32 (diff) | |
download | online_test-48366e84b98157ac32b22b2aa19b1c1cde68afd4.tar.gz online_test-48366e84b98157ac32b22b2aa19b1c1cde68afd4.tar.bz2 online_test-48366e84b98157ac32b22b2aa19b1c1cde68afd4.zip |
Merge pull request #166 from ankitjavalkar/error-refactor-for-mod
Prettify Error rendering during code questions and grading page
Diffstat (limited to 'yaksh/evaluator_tests/test_scilab_evaluation.py')
-rw-r--r-- | yaksh/evaluator_tests/test_scilab_evaluation.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/yaksh/evaluator_tests/test_scilab_evaluation.py b/yaksh/evaluator_tests/test_scilab_evaluation.py index 0275ee8..938d0e5 100644 --- a/yaksh/evaluator_tests/test_scilab_evaluation.py +++ b/yaksh/evaluator_tests/test_scilab_evaluation.py @@ -7,8 +7,10 @@ import tempfile from yaksh import grader as gd from yaksh.grader import Grader from yaksh.scilab_code_evaluator import ScilabCodeEvaluator +from yaksh.evaluator_tests.test_python_evaluation import EvaluatorBaseTest -class ScilabEvaluationTestCases(unittest.TestCase): + +class ScilabEvaluationTestCases(EvaluatorBaseTest): def setUp(self): tmp_in_dir_path = tempfile.mkdtemp() self.test_case_data = [{"test_case": "scilab_files/test_add.sce", @@ -42,7 +44,6 @@ class ScilabEvaluationTestCases(unittest.TestCase): grader = Grader(self.in_dir) result = grader.evaluate(kwargs) - self.assertEqual(result.get('error'), "Correct answer\n") self.assertTrue(result.get('success')) def test_error(self): @@ -62,7 +63,7 @@ class ScilabEvaluationTestCases(unittest.TestCase): result = grader.evaluate(kwargs) self.assertFalse(result.get("success")) - self.assertTrue('error' in result.get("error")) + self.assert_correct_output('error', result.get("error")) def test_incorrect_answer(self): @@ -81,9 +82,9 @@ class ScilabEvaluationTestCases(unittest.TestCase): grader = Grader(self.in_dir) result = grader.evaluate(kwargs) - lines_of_error = len(result.get('error').splitlines()) + lines_of_error = len(result.get('error')[0].splitlines()) self.assertFalse(result.get('success')) - self.assertIn("Message", result.get('error')) + self.assert_correct_output("Message", result.get('error')) self.assertTrue(lines_of_error > 1) def test_infinite_loop(self): @@ -103,7 +104,7 @@ class ScilabEvaluationTestCases(unittest.TestCase): result = grader.evaluate(kwargs) self.assertFalse(result.get("success")) - self.assertEqual(result.get("error"), self.timeout_msg) + self.assert_correct_output(self.timeout_msg, result.get("error")) if __name__ == '__main__': unittest.main() |