diff options
author | mahesh | 2017-05-22 14:32:47 +0530 |
---|---|---|
committer | mahesh | 2017-05-22 14:32:47 +0530 |
commit | 77f05d3df90a70ff97285deb5bda2d91d99e65d5 (patch) | |
tree | cf292b268f8f8dc322ea8bd50d2bbd65abef39e7 /yaksh/evaluator_tests | |
parent | 153f738c3c43b26339fb625aba8336b3f8265991 (diff) | |
download | online_test-77f05d3df90a70ff97285deb5bda2d91d99e65d5.tar.gz online_test-77f05d3df90a70ff97285deb5bda2d91d99e65d5.tar.bz2 online_test-77f05d3df90a70ff97285deb5bda2d91d99e65d5.zip |
changes variable and dict key names along with other minor changes in answerpaper.
Diffstat (limited to 'yaksh/evaluator_tests')
-rw-r--r-- | yaksh/evaluator_tests/test_bash_evaluation.py | 2 | ||||
-rw-r--r-- | yaksh/evaluator_tests/test_c_cpp_evaluation.py | 8 | ||||
-rw-r--r-- | yaksh/evaluator_tests/test_java_evaluation.py | 4 | ||||
-rw-r--r-- | yaksh/evaluator_tests/test_python_evaluation.py | 2 | ||||
-rw-r--r-- | yaksh/evaluator_tests/test_python_stdio_evaluator.py | 22 |
5 files changed, 19 insertions, 19 deletions
diff --git a/yaksh/evaluator_tests/test_bash_evaluation.py b/yaksh/evaluator_tests/test_bash_evaluation.py index d19ef1c..6e7410e 100644 --- a/yaksh/evaluator_tests/test_bash_evaluation.py +++ b/yaksh/evaluator_tests/test_bash_evaluation.py @@ -242,7 +242,7 @@ class BashStdIOEvaluationTestCases(EvaluatorBaseTest): result = grader.evaluate(kwargs) # Then - result_error = result.get('error')[0].get('error') + result_error = result.get('error')[0].get('error_msg') self.assert_correct_output("Incorrect", result_error) self.assertFalse(result.get('success')) diff --git a/yaksh/evaluator_tests/test_c_cpp_evaluation.py b/yaksh/evaluator_tests/test_c_cpp_evaluation.py index 46d5593..5ff4e4c 100644 --- a/yaksh/evaluator_tests/test_c_cpp_evaluation.py +++ b/yaksh/evaluator_tests/test_c_cpp_evaluation.py @@ -350,8 +350,8 @@ class CppStdIOEvaluationTestCases(EvaluatorBaseTest): result = grader.evaluate(kwargs) # Then - lines_of_error = len(result.get('error')[0].get('error_no')) - result_error = result.get('error')[0].get('error') + lines_of_error = len(result.get('error')[0].get('error_line_numbers')) + result_error = result.get('error')[0].get('error_msg') self.assertFalse(result.get('success')) self.assert_correct_output("Incorrect", result_error) self.assertTrue(lines_of_error > 0) @@ -559,8 +559,8 @@ class CppStdIOEvaluationTestCases(EvaluatorBaseTest): result = grader.evaluate(kwargs) # Then - lines_of_error = len(result.get('error')[0].get('error_no')) - result_error = result.get('error')[0].get('error') + lines_of_error = len(result.get('error')[0].get('error_line_numbers')) + result_error = result.get('error')[0].get('error_msg') self.assertFalse(result.get('success')) self.assert_correct_output("Incorrect", result_error) self.assertTrue(lines_of_error > 0) diff --git a/yaksh/evaluator_tests/test_java_evaluation.py b/yaksh/evaluator_tests/test_java_evaluation.py index 7046aa1..c733586 100644 --- a/yaksh/evaluator_tests/test_java_evaluation.py +++ b/yaksh/evaluator_tests/test_java_evaluation.py @@ -349,8 +349,8 @@ class JavaStdIOEvaluationTestCases(EvaluatorBaseTest): result = grader.evaluate(kwargs) # Then - lines_of_error = len(result.get('error')[0].get('error_no')) - result_error = result.get('error')[0].get('error') + lines_of_error = len(result.get('error')[0].get('error_line_numbers')) + result_error = result.get('error')[0].get('error_msg') self.assertFalse(result.get('success')) self.assert_correct_output("Incorrect", result_error) self.assertTrue(lines_of_error > 0) diff --git a/yaksh/evaluator_tests/test_python_evaluation.py b/yaksh/evaluator_tests/test_python_evaluation.py index 8b18c9a..a2faf77 100644 --- a/yaksh/evaluator_tests/test_python_evaluation.py +++ b/yaksh/evaluator_tests/test_python_evaluation.py @@ -614,7 +614,7 @@ class PythonStdIOEvaluationTestCases(EvaluatorBaseTest): self.assertFalse(result.get('success')) self.assert_correct_output( "Incorrect Answer: Line number(s) 1 did not match.", - result.get('error')[0].get('error') + result.get('error')[0].get('error_msg') ) def test_file_based_answer(self): diff --git a/yaksh/evaluator_tests/test_python_stdio_evaluator.py b/yaksh/evaluator_tests/test_python_stdio_evaluator.py index 9eab763..8877544 100644 --- a/yaksh/evaluator_tests/test_python_stdio_evaluator.py +++ b/yaksh/evaluator_tests/test_python_stdio_evaluator.py @@ -1,39 +1,39 @@ -from yaksh.compare_stdio import CompareOutputs +from yaksh.compare_stdio import compare_outputs def test_compare_outputs(): exp = "5\n5\n" given = "5\n5\n" - success, msg = CompareOutputs().compare_outputs(given, exp) + success, msg = compare_outputs(given, exp) assert success exp = "5\n5\n" given = "5\n5" - success, msg = CompareOutputs().compare_outputs(given, exp) + success, msg = compare_outputs(given, exp) assert success exp = "5\r5" given = "5\n5" - success, msg = CompareOutputs().compare_outputs(given, exp) + success, msg = compare_outputs(given, exp) assert success exp = " 5 \r 5 " given = " 5 \n 5 " - success, msg = CompareOutputs().compare_outputs(given, exp) + success, msg = compare_outputs(given, exp) assert success exp = "5\n5\n" given = "5 5" - success, msg = CompareOutputs().compare_outputs(given, exp) - error_msg = msg.get('error') + success, msg = compare_outputs(given, exp) + error_msg = msg.get('error_msg') assert not success - m = "Incorrect Answer: We had expected 1 number of lines."\ - + " We got 2 number of lines." + m = ("Incorrect Answer: We had expected 1 number of lines. " + + "We got 2 number of lines.") assert m == error_msg exp = "5\n5\n" given = "5\n6" - success, msg = CompareOutputs().compare_outputs(given, exp) - error_msg = msg.get('error') + success, msg = compare_outputs(given, exp) + error_msg = msg.get('error_msg') m = "Incorrect Answer: Line number(s) 2 did not match." assert not success assert m == error_msg |