summaryrefslogtreecommitdiff
path: root/yaksh/evaluator_tests/test_scilab_evaluation.py
diff options
context:
space:
mode:
authorankitjavalkar2016-05-09 13:00:04 +0530
committerankitjavalkar2016-05-10 11:54:34 +0530
commitc384c60c6d7fb5d30f3f929c518e0b41e084c4c4 (patch)
treed5b937e90bc7d3051b9c9128c4e1560b09db1c2c /yaksh/evaluator_tests/test_scilab_evaluation.py
parentd953f6f9e62671eeb5d6ea6498475167301dfe91 (diff)
downloadonline_test-c384c60c6d7fb5d30f3f929c518e0b41e084c4c4.tar.gz
online_test-c384c60c6d7fb5d30f3f929c518e0b41e084c4c4.tar.bz2
online_test-c384c60c6d7fb5d30f3f929c518e0b41e084c4c4.zip
- Adhere to 80 columns
- add docstrings - Fix further tests
Diffstat (limited to 'yaksh/evaluator_tests/test_scilab_evaluation.py')
-rw-r--r--yaksh/evaluator_tests/test_scilab_evaluation.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/yaksh/evaluator_tests/test_scilab_evaluation.py b/yaksh/evaluator_tests/test_scilab_evaluation.py
index 24d6740..242f260 100644
--- a/yaksh/evaluator_tests/test_scilab_evaluation.py
+++ b/yaksh/evaluator_tests/test_scilab_evaluation.py
@@ -9,10 +9,12 @@ class ScilabEvaluationTestCases(unittest.TestCase):
self.test_case_data = [{"test_case": "scilab_files/test_add.sce"}]
self.in_dir = "/tmp"
self.timeout_msg = ("Code took more than {0} seconds to run. "
- "You probably have an infinite loop in your code.").format(SERVER_TIMEOUT)
+ "You probably have an infinite loop"
+ " in your code.").format(SERVER_TIMEOUT)
def test_correct_answer(self):
- user_answer = "funcprot(0)\nfunction[c]=add(a,b)\n\tc=a+b;\nendfunction"
+ user_answer = ("funcprot(0)\nfunction[c]=add(a,b)"
+ "\n\tc=a+b;\nendfunction")
get_class = ScilabCodeEvaluator(self.in_dir)
kwargs = {'user_answer': user_answer,
'test_case_data': self.test_case_data
@@ -22,7 +24,8 @@ class ScilabEvaluationTestCases(unittest.TestCase):
self.assertTrue(result.get('success'))
def test_error(self):
- user_answer = "funcprot(0)\nfunction[c]=add(a,b)\n\tc=a+b;\ndis(\tendfunction"
+ user_answer = ("funcprot(0)\nfunction[c]=add(a,b)"
+ "\n\tc=a+b;\ndis(\tendfunction")
get_class = ScilabCodeEvaluator(self.in_dir)
kwargs = {'user_answer': user_answer,
'test_case_data': self.test_case_data
@@ -33,7 +36,8 @@ class ScilabEvaluationTestCases(unittest.TestCase):
def test_incorrect_answer(self):
- user_answer = "funcprot(0)\nfunction[c]=add(a,b)\n\tc=a-b;\nendfunction"
+ user_answer = ("funcprot(0)\nfunction[c]=add(a,b)"
+ "\n\tc=a-b;\nendfunction")
get_class = ScilabCodeEvaluator(self.in_dir)
kwargs = {'user_answer': user_answer,
'test_case_data': self.test_case_data
@@ -44,7 +48,8 @@ class ScilabEvaluationTestCases(unittest.TestCase):
self.assertTrue(result.get('error').splitlines > 1)
def test_infinite_loop(self):
- user_answer = "funcprot(0)\nfunction[c]=add(a,b)\n\tc=a;\nwhile(1==1)\nend\nendfunction"
+ user_answer = ("funcprot(0)\nfunction[c]=add(a,b)"
+ "\n\tc=a;\nwhile(1==1)\nend\nendfunction")
get_class = ScilabCodeEvaluator(self.in_dir)
kwargs = {'user_answer': user_answer,
'test_case_data': self.test_case_data