diff options
author | adityacp | 2016-12-23 15:03:37 +0530 |
---|---|---|
committer | adityacp | 2016-12-23 15:03:37 +0530 |
commit | d442941819dc7f8b65a2965fbcefe000fea1cde2 (patch) | |
tree | 624d8ba12cf83cf57f685bc8cee158be14aee783 /yaksh/evaluator_tests/test_scilab_evaluation.py | |
parent | 14b628f49a7d0aa58c22c021c62a5d0a748ae881 (diff) | |
parent | 48366e84b98157ac32b22b2aa19b1c1cde68afd4 (diff) | |
download | online_test-d442941819dc7f8b65a2965fbcefe000fea1cde2.tar.gz online_test-d442941819dc7f8b65a2965fbcefe000fea1cde2.tar.bz2 online_test-d442941819dc7f8b65a2965fbcefe000fea1cde2.zip |
Fix conflict
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 c6b3b54..5a452a3 100644 --- a/yaksh/evaluator_tests/test_scilab_evaluation.py +++ b/yaksh/evaluator_tests/test_scilab_evaluation.py @@ -7,8 +7,10 @@ from textwrap import dedent 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.tc_data = dedent(""" @@ -73,7 +75,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): @@ -93,7 +94,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): @@ -112,9 +113,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): @@ -134,7 +135,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() |