diff options
author | maheshgudi | 2017-02-06 23:46:08 +0530 |
---|---|---|
committer | maheshgudi | 2017-02-06 23:46:08 +0530 |
commit | 7b9a56db9113bf6b7ef9351db8fcda748e9c2be4 (patch) | |
tree | 58757b8835e140e18cf57e3cb118e7a622e5b966 /yaksh | |
parent | aa7e5519a4f3809ad42eeaceb2a14b6190c5d345 (diff) | |
download | online_test-7b9a56db9113bf6b7ef9351db8fcda748e9c2be4.tar.gz online_test-7b9a56db9113bf6b7ef9351db8fcda748e9c2be4.tar.bz2 online_test-7b9a56db9113bf6b7ef9351db8fcda748e9c2be4.zip |
changed and fixed test case
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/evaluator_tests/test_python_evaluation.py | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/yaksh/evaluator_tests/test_python_evaluation.py b/yaksh/evaluator_tests/test_python_evaluation.py index a463513..6346941 100644 --- a/yaksh/evaluator_tests/test_python_evaluation.py +++ b/yaksh/evaluator_tests/test_python_evaluation.py @@ -453,13 +453,12 @@ class PythonAssertionEvaluationTestCases(EvaluatorBaseTest): def test_unicode_literal_bug(self): # Given user_answer = dedent("""\ - def isize(s): - import numpy as np - size = np.array(s).itemsize - return size + def strchar(s): + a = "should be a string" + return type(a) """) test_case_data = [{"test_case_type": "standardtestcase", - "test_case": 'assert(isize("hello")==5)', + "test_case": 'assert(strchar("hello")==str)', "weight": 0.0 },] kwargs = { @@ -476,10 +475,7 @@ class PythonAssertionEvaluationTestCases(EvaluatorBaseTest): result = grader.evaluate(kwargs) # Then - if sys.version[0] < 3: - self.assertTrue(result.get("success")) - else: - self.assertFalse(result.get("success")) + self.assertTrue(result.get("success")) class PythonStdIOEvaluationTestCases(EvaluatorBaseTest): @@ -680,13 +676,12 @@ class PythonStdIOEvaluationTestCases(EvaluatorBaseTest): def test_unicode_literal_bug(self): # Given user_answer = dedent("""\ - import numpy as np - size = np.array(s).itemsize - print size + a = "this should be a string." + print(type(a).__name__) """) test_case_data = [{"test_case_type": "stdiobasedtestcase", "expected_input": "", - "expected_output": "5", + "expected_output": "str", "weight": 0.0 }] kwargs = { @@ -702,11 +697,7 @@ class PythonStdIOEvaluationTestCases(EvaluatorBaseTest): grader = Grader(self.in_dir) result = grader.evaluate(kwargs) # Then - if sys.version[0] < 3: - self.assertTrue(result.get("success")) - else: - self.assertFalse(result.get("success")) - + self.assertTrue(result.get("success")) class PythonHookEvaluationTestCases(EvaluatorBaseTest): |