summaryrefslogtreecommitdiff
path: root/yaksh/evaluator_tests
diff options
context:
space:
mode:
authorankitjavalkar2016-12-21 18:09:49 +0530
committerankitjavalkar2016-12-21 18:17:48 +0530
commita88197040b69a556f9c7b0432350b9d1d4aad06f (patch)
tree9a3dd0a6a7977033d28e351c8a866c495449c530 /yaksh/evaluator_tests
parentfb991b4792b48c80e269236bf5aa28a70d34dbf6 (diff)
downloadonline_test-a88197040b69a556f9c7b0432350b9d1d4aad06f.tar.gz
online_test-a88197040b69a556f9c7b0432350b9d1d4aad06f.tar.bz2
online_test-a88197040b69a556f9c7b0432350b9d1d4aad06f.zip
Fix rendering and representation of errors
- Error are sent as list - Error are None if answer is fully correct - Error is rendered as in grade user and code questions as neat CSS divs - Fix corresponding test cases - Fix get_question answers in models.py
Diffstat (limited to 'yaksh/evaluator_tests')
-rw-r--r--yaksh/evaluator_tests/test_java_evaluation.py6
-rw-r--r--yaksh/evaluator_tests/test_python_evaluation.py5
2 files changed, 1 insertions, 10 deletions
diff --git a/yaksh/evaluator_tests/test_java_evaluation.py b/yaksh/evaluator_tests/test_java_evaluation.py
index 503372e..bfba38f 100644
--- a/yaksh/evaluator_tests/test_java_evaluation.py
+++ b/yaksh/evaluator_tests/test_java_evaluation.py
@@ -52,7 +52,6 @@ class JavaAssertionEvaluationTestCases(EvaluatorBaseTest):
grader = Grader(self.in_dir)
result = grader.evaluate(kwargs)
- self.assert_correct_output("Correct answer", result.get('error'))
self.assertTrue(result.get('success'))
def test_incorrect_answer(self):
@@ -152,7 +151,6 @@ class JavaAssertionEvaluationTestCases(EvaluatorBaseTest):
result = grader.evaluate(kwargs)
self.assertTrue(result.get("success"))
- self.assert_correct_output("Correct answer", result.get("error"))
class JavaStdIOEvaluationTestCases(EvaluatorBaseTest):
def setUp(self):
@@ -199,7 +197,6 @@ class JavaStdIOEvaluationTestCases(EvaluatorBaseTest):
grader = Grader(self.in_dir)
result = grader.evaluate(kwargs)
- self.assert_correct_output("Correct answer", result.get('error'))
self.assertTrue(result.get('success'))
def test_array_input(self):
@@ -333,7 +330,6 @@ class JavaStdIOEvaluationTestCases(EvaluatorBaseTest):
grader = Grader(self.in_dir)
result = grader.evaluate(kwargs)
- self.assert_correct_output("Correct answer", result.get('error'))
self.assertTrue(result.get('success'))
def test_string_input(self):
@@ -364,7 +360,6 @@ class JavaStdIOEvaluationTestCases(EvaluatorBaseTest):
grader = Grader(self.in_dir)
result = grader.evaluate(kwargs)
- self.assert_correct_output("Correct answer", result.get('error'))
self.assertTrue(result.get('success'))
def test_file_based_stdout(self):
@@ -406,7 +401,6 @@ class JavaStdIOEvaluationTestCases(EvaluatorBaseTest):
result = grader.evaluate(kwargs)
self.assertTrue(result.get("success"))
- self.assert_correct_output("Correct answer", result.get("error"))
if __name__ == '__main__':
diff --git a/yaksh/evaluator_tests/test_python_evaluation.py b/yaksh/evaluator_tests/test_python_evaluation.py
index 291e639..c58d7f1 100644
--- a/yaksh/evaluator_tests/test_python_evaluation.py
+++ b/yaksh/evaluator_tests/test_python_evaluation.py
@@ -56,7 +56,6 @@ class PythonAssertionEvaluationTestCases(EvaluatorBaseTest):
# Then
self.assertTrue(result.get('success'))
- self.assert_correct_output("Correct answer", result.get('error'))
def test_incorrect_answer(self):
# Given
@@ -368,7 +367,6 @@ class PythonAssertionEvaluationTestCases(EvaluatorBaseTest):
result = grader.evaluate(kwargs)
# Then
- self.assert_correct_output("Correct answer", result.get('error'))
self.assertTrue(result.get('success'))
def test_single_testcase_error(self):
@@ -449,7 +447,7 @@ class PythonAssertionEvaluationTestCases(EvaluatorBaseTest):
# Then
self.assertFalse(result.get("success"))
- self.assertEqual(5, len(err))
+ self.assertEqual(2, len(err))
for msg in name_error_msg:
self.assert_correct_output(msg, result.get("error"))
@@ -613,7 +611,6 @@ class PythonStdIOEvaluationTestCases(EvaluatorBaseTest):
result = grader.evaluate(kwargs)
# Then
- self.assert_correct_output("Correct answer", result.get('error'))
self.assertTrue(result.get('success'))
def test_infinite_loop(self):