summaryrefslogtreecommitdiff
path: root/yaksh/evaluator_tests/test_bash_evaluation.py
diff options
context:
space:
mode:
authorankitjavalkar2016-09-21 15:07:43 +0530
committerankitjavalkar2016-09-30 10:33:42 +0530
commitac8d6720bc75676e05462cc38ad144d5aedc14e7 (patch)
treee2e527e159a0704ecdaa2f15ae13900f4555ea63 /yaksh/evaluator_tests/test_bash_evaluation.py
parent6b08e56fe3cf70ffbcbd1ed432dde25babe48148 (diff)
downloadonline_test-ac8d6720bc75676e05462cc38ad144d5aedc14e7.tar.gz
online_test-ac8d6720bc75676e05462cc38ad144d5aedc14e7.tar.bz2
online_test-ac8d6720bc75676e05462cc38ad144d5aedc14e7.zip
Migrate python code server and evaluators to python 2/3 compatible
Diffstat (limited to 'yaksh/evaluator_tests/test_bash_evaluation.py')
-rwxr-xr-xyaksh/evaluator_tests/test_bash_evaluation.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/yaksh/evaluator_tests/test_bash_evaluation.py b/yaksh/evaluator_tests/test_bash_evaluation.py
index 084e5e4..01e248f 100755
--- a/yaksh/evaluator_tests/test_bash_evaluation.py
+++ b/yaksh/evaluator_tests/test_bash_evaluation.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
import unittest
import os
from yaksh.bash_code_evaluator import BashCodeEvaluator
@@ -28,7 +29,7 @@ class BashAssertionEvaluationTestCases(unittest.TestCase):
}
result = get_class.evaluate(**kwargs)
self.assertTrue(result.get('success'))
- self.assertEquals(result.get('error'), "Correct answer")
+ self.assertEqual(result.get('error'), "Correct answer")
def test_error(self):
user_answer = ("#!/bin/bash\n[[ $# -eq 2 ]] "
@@ -52,7 +53,7 @@ class BashAssertionEvaluationTestCases(unittest.TestCase):
}
result = get_class.evaluate(**kwargs)
self.assertFalse(result.get("success"))
- self.assertEquals(result.get("error"), self.timeout_msg)
+ self.assertEqual(result.get("error"), self.timeout_msg)
def test_file_based_assert(self):
self.file_paths = [(os.getcwd()+"/yaksh/test.txt", False)]
@@ -67,7 +68,7 @@ class BashAssertionEvaluationTestCases(unittest.TestCase):
}
result = get_class.evaluate(**kwargs)
self.assertTrue(result.get("success"))
- self.assertEquals(result.get("error"), "Correct answer")
+ self.assertEqual(result.get("error"), "Correct answer")
class BashStdioEvaluationTestCases(unittest.TestCase):
def setUp(self):
@@ -88,7 +89,7 @@ class BashStdioEvaluationTestCases(unittest.TestCase):
"test_case_data": test_case_data
}
result = get_class.evaluate(**kwargs)
- self.assertEquals(result.get('error'), "Correct answer")
+ self.assertEqual(result.get('error'), "Correct Answer")
self.assertTrue(result.get('success'))
def test_array_input(self):
@@ -108,7 +109,7 @@ class BashStdioEvaluationTestCases(unittest.TestCase):
"test_case_data": test_case_data
}
result = get_class.evaluate(**kwargs)
- self.assertEquals(result.get('error'), "Correct answer")
+ self.assertEqual(result.get('error'), "Correct Answer")
self.assertTrue(result.get('success'))
def test_incorrect_answer(self):
@@ -142,7 +143,7 @@ class BashStdioEvaluationTestCases(unittest.TestCase):
"test_case_data": test_case_data
}
result = get_class.evaluate(**kwargs)
- self.assertEquals(result.get('error'), "Correct answer")
+ self.assertEqual(result.get('error'), "Correct Answer")
self.assertTrue(result.get('success'))
if __name__ == '__main__':