summaryrefslogtreecommitdiff
path: root/yaksh/evaluator_tests
diff options
context:
space:
mode:
authormaheshgudi2016-07-28 18:24:18 +0530
committermaheshgudi2016-07-28 18:24:18 +0530
commit1b71abc9437d721a41f017db406f312755f5a4c4 (patch)
treee4fac39cf722608c1f8bf0d208b8a3e8c39f2d9f /yaksh/evaluator_tests
parent9411ab221e007a6c3e2901ce34f38f2267288b6e (diff)
downloadonline_test-1b71abc9437d721a41f017db406f312755f5a4c4.tar.gz
online_test-1b71abc9437d721a41f017db406f312755f5a4c4.tar.bz2
online_test-1b71abc9437d721a41f017db406f312755f5a4c4.zip
added expected input in traceback for python and made minor changes in bash_stio_evaluator and stdio_evaluator
Diffstat (limited to 'yaksh/evaluator_tests')
-rw-r--r--yaksh/evaluator_tests/test_bash_evaluation.py4
-rw-r--r--yaksh/evaluator_tests/test_python_evaluation.py14
2 files changed, 2 insertions, 16 deletions
diff --git a/yaksh/evaluator_tests/test_bash_evaluation.py b/yaksh/evaluator_tests/test_bash_evaluation.py
index f954ef0..ee6c1f0 100644
--- a/yaksh/evaluator_tests/test_bash_evaluation.py
+++ b/yaksh/evaluator_tests/test_bash_evaluation.py
@@ -97,10 +97,10 @@ class BashStdioEvaluationTestCases(unittest.TestCase):
user_answer = dedent(""" #!/bin/bash
read A
read B
- echo -n `expr $A + $B`
+ echo -n `expr $A - $B`
"""
)
- test_case_data = [{'expected_output': '12', 'expected_input': '5\n6'}]
+ test_case_data = [{'expected_output': '11', 'expected_input': '5\n6'}]
get_class = BashStdioEvaluator()
kwargs = {"user_answer": user_answer,
"test_case_data": test_case_data
diff --git a/yaksh/evaluator_tests/test_python_evaluation.py b/yaksh/evaluator_tests/test_python_evaluation.py
index a935f1d..40562db 100644
--- a/yaksh/evaluator_tests/test_python_evaluation.py
+++ b/yaksh/evaluator_tests/test_python_evaluation.py
@@ -211,20 +211,6 @@ class PythonStdoutEvaluationTestCases(unittest.TestCase):
self.assertFalse(result.get('success'))
self.assertIn("Incorrect Answer", result.get('error'))
- def test_direct_printed_answer(self):
- user_answer = "print '0 1 1 2 3'"
- error_msg = ("Incorrect Answer: Please avoid printing"
- " the expected output directly"
- )
- get_class = PythonStdioEvaluator()
-
- kwargs = {'user_answer': user_answer,
- 'test_case_data': self.test_case_data
- }
- result = get_class.evaluate(**kwargs)
- self.assertFalse(result.get('success'))
- self.assertEqual(result.get('error'), error_msg)
-
def test_infinite_loop(self):
user_answer = "def add(a, b):\n\twhile True:\n\t\tpass\nadd(1,2)"
get_class = PythonStdioEvaluator()