diff options
author | maheshgudi | 2017-01-09 12:48:37 +0530 |
---|---|---|
committer | maheshgudi | 2017-01-09 18:10:30 +0530 |
commit | cf4f207f710b9f67e0973a99f5894c4a866bca4c (patch) | |
tree | 8426a0d1611a406e2fbbf3cc5d8e4a1ae91bcb10 /yaksh/evaluator_tests/test_bash_evaluation.py | |
parent | 6b8f8f53d7110e27bc44f0d50b8b3155155932f6 (diff) | |
download | online_test-cf4f207f710b9f67e0973a99f5894c4a866bca4c.tar.gz online_test-cf4f207f710b9f67e0973a99f5894c4a866bca4c.tar.bz2 online_test-cf4f207f710b9f67e0973a99f5894c4a866bca4c.zip |
modified tests and hook evaluator for python 3
Diffstat (limited to 'yaksh/evaluator_tests/test_bash_evaluation.py')
-rw-r--r-- | yaksh/evaluator_tests/test_bash_evaluation.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/yaksh/evaluator_tests/test_bash_evaluation.py b/yaksh/evaluator_tests/test_bash_evaluation.py index 0662831..482d45e 100644 --- a/yaksh/evaluator_tests/test_bash_evaluation.py +++ b/yaksh/evaluator_tests/test_bash_evaluation.py @@ -303,7 +303,7 @@ class BashHookEvaluationTestCases(EvaluatorBaseTest): stderr=subprocess.PIPE ) stdout,stderr = proc.communicate() - if stdout == "Hello, world!": + if stdout.decode("utf-8") == "Hello, world!": success, err, mark_fraction = True, "", 1.0 return success, err, mark_fraction """ @@ -346,7 +346,7 @@ class BashHookEvaluationTestCases(EvaluatorBaseTest): stderr=subprocess.PIPE ) stdout,stderr = proc.communicate() - if stdout == "Hello, world!": + if stdout.decode("utf-8") == "Hello, world!": success, err, mark_fraction = True, "", 1.0 return success, err, mark_fraction """ @@ -444,6 +444,7 @@ class BashHookEvaluationTestCases(EvaluatorBaseTest): hook_code_2 = dedent("""\ def check_answer(user_answer): import subprocess + import sys success = False err = "Incorrect Answer" mark_fraction = 0.0 @@ -452,7 +453,8 @@ class BashHookEvaluationTestCases(EvaluatorBaseTest): stderr=subprocess.PIPE ) stdout,stderr = proc.communicate() - if stdout == "Hello, world!": + + if stdout.decode('utf-8') == "Hello, world!": success, err, mark_fraction = True, "", 1.0 return success, err, mark_fraction """ @@ -498,7 +500,7 @@ class BashHookEvaluationTestCases(EvaluatorBaseTest): stderr=subprocess.PIPE ) stdout,stderr = proc.communicate() - if stdout == "Hello, world!": + if stdout.decode("utf-8") == "Hello, world!": success, err, mark_fraction = True, "", 1.0 return success, err, mark_fraction """ |