summaryrefslogtreecommitdiff
path: root/yaksh/evaluator_tests
diff options
context:
space:
mode:
authorprathamesh2020-04-02 16:33:20 +0530
committerprathamesh2020-04-02 16:53:00 +0530
commit2e360f7d5772c3059a42db8915530cde952a01c6 (patch)
treef253fc25a4f449dda1fa7bcfccb816ecf119cb29 /yaksh/evaluator_tests
parent61abccdcb0b0a44f4db60e3bb4d09d1ec5dc50e3 (diff)
downloadonline_test-2e360f7d5772c3059a42db8915530cde952a01c6.tar.gz
online_test-2e360f7d5772c3059a42db8915530cde952a01c6.tar.bz2
online_test-2e360f7d5772c3059a42db8915530cde952a01c6.zip
Show prettified R error messages and fix filter
R language available in filter form. Values taken from models. R messages are prettified like python assertion messages. Text up to first colon in the R error message removed, as it is simply a filename or unwanted text.
Diffstat (limited to 'yaksh/evaluator_tests')
-rw-r--r--yaksh/evaluator_tests/test_r_evaluation.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/yaksh/evaluator_tests/test_r_evaluation.py b/yaksh/evaluator_tests/test_r_evaluation.py
index b161dc9..b4b81ae 100644
--- a/yaksh/evaluator_tests/test_r_evaluation.py
+++ b/yaksh/evaluator_tests/test_r_evaluation.py
@@ -94,7 +94,7 @@ class RAssertionEvaluationTestCase(EvaluatorBaseTest):
}
'''
)
- err = ['Error: input == output is not TRUE\nExecution halted\n']
+ err = 'input == output is not TRUE\nExecution halted\n'
kwargs = {'metadata': {
'user_answer': user_answer,
'file_paths': self.file_paths,
@@ -109,7 +109,7 @@ class RAssertionEvaluationTestCase(EvaluatorBaseTest):
errors = result.get('error')
# Then
self.assertFalse(result.get('success'))
- self.assertEqual(errors, err)
+ self.assertEqual(errors[0]['message'], err)
def test_error_code(self):
# Given
@@ -135,7 +135,7 @@ class RAssertionEvaluationTestCase(EvaluatorBaseTest):
# Then
self.assertFalse(result.get("success"))
- self.assertIn("object 'a' not found", errors[0])
+ self.assertIn("object 'a' not found", errors[0]['message'])
def test_empty_function(self):
# Given
@@ -160,7 +160,8 @@ class RAssertionEvaluationTestCase(EvaluatorBaseTest):
# Then
self.assertFalse(result.get("success"))
- self.assertIn("Error: is.null(obj) == FALSE is not TRUE", errors[0])
+ err = errors[0]['message']
+ self.assertIn("is.null(obj) == FALSE is not TRUE", err)
def test_infinite_loop(self):
# Given