summaryrefslogtreecommitdiff
path: root/yaksh/evaluator_tests
diff options
context:
space:
mode:
authormaheshgudi2016-09-16 23:47:05 +0530
committermaheshgudi2016-09-16 23:47:05 +0530
commit3bd95ba800d195e531204d6f2245601486af6e2b (patch)
tree397a31fb484ad2f192ba6a941fa9dd3c442e4efd /yaksh/evaluator_tests
parent2a2bd1674f1373fb684a1c36e0c48512bc632b86 (diff)
downloadonline_test-3bd95ba800d195e531204d6f2245601486af6e2b.tar.gz
online_test-3bd95ba800d195e531204d6f2245601486af6e2b.tar.bz2
online_test-3bd95ba800d195e531204d6f2245601486af6e2b.zip
added docstrings for testcases, removed timeout exception from python evaluator
Diffstat (limited to 'yaksh/evaluator_tests')
-rw-r--r--yaksh/evaluator_tests/test_python_evaluation.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/yaksh/evaluator_tests/test_python_evaluation.py b/yaksh/evaluator_tests/test_python_evaluation.py
index 2305f3b..1087c5d 100644
--- a/yaksh/evaluator_tests/test_python_evaluation.py
+++ b/yaksh/evaluator_tests/test_python_evaluation.py
@@ -208,6 +208,8 @@ class PythonAssertionEvaluationTestCases(unittest.TestCase):
self.assertTrue(result.get('success'))
def test_single_testcase_error(self):
+ """ Tests the user answer with just an incorrect test case """
+
user_answer = "def palindrome(a):\n\treturn a == a[::-1]"
test_case_data = [{"test_case": 's="abbb"\nasert palindrome(s)==False'}
]
@@ -233,6 +235,9 @@ class PythonAssertionEvaluationTestCases(unittest.TestCase):
def test_multiple_testcase_error(self):
+ """ Tests the user answer with an correct test case
+ first and then with an incorrect test case """
+
user_answer = "def palindrome(a):\n\treturn a == a[::-1]"
test_case_data = [{"test_case": 'assert(palindrome("abba")==True)'},
{"test_case": 's="abbb"\nassert palindrome(S)==False'}