summaryrefslogtreecommitdiff
path: root/yaksh/evaluator_tests
diff options
context:
space:
mode:
authorPalaparthy Adityachandra2020-04-07 14:26:42 +0530
committerGitHub2020-04-07 14:26:42 +0530
commite08af49ea33585f101335d0c25b1ea22f85fcdd0 (patch)
tree52a59e94012fd4badbe57f4f1fb031c80e306742 /yaksh/evaluator_tests
parent12af42a922679a33ce52df24499e165474fbd7d2 (diff)
parent2e360f7d5772c3059a42db8915530cde952a01c6 (diff)
downloadonline_test-e08af49ea33585f101335d0c25b1ea22f85fcdd0.tar.gz
online_test-e08af49ea33585f101335d0c25b1ea22f85fcdd0.tar.bz2
online_test-e08af49ea33585f101335d0c25b1ea22f85fcdd0.zip
Merge pull request #678 from prathamesh920/r-clean-error-messages
Show prettified R error messages and fix filter
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