summaryrefslogtreecommitdiff
path: root/testapp/test_server.py
diff options
context:
space:
mode:
authorprathamesh2014-05-12 15:13:33 +0530
committerprathamesh2014-05-12 15:13:33 +0530
commitfa1cdf5c8f92715f2b3866f0a17e2439d27557c5 (patch)
treec0020a1bbcc24d7ef7372e4ae53133dfc4b28523 /testapp/test_server.py
parent3244b69143adb3f86ca2bbdfbbc1b8a93489de29 (diff)
downloadonline_test-fa1cdf5c8f92715f2b3866f0a17e2439d27557c5.tar.gz
online_test-fa1cdf5c8f92715f2b3866f0a17e2439d27557c5.tar.bz2
online_test-fa1cdf5c8f92715f2b3866f0a17e2439d27557c5.zip
Files modified according to the pep8 coding standard.
Diffstat (limited to 'testapp/test_server.py')
-rw-r--r--testapp/test_server.py27
1 files changed, 13 insertions, 14 deletions
diff --git a/testapp/test_server.py b/testapp/test_server.py
index 2a17739..95f87ef 100644
--- a/testapp/test_server.py
+++ b/testapp/test_server.py
@@ -24,16 +24,16 @@ def test_python():
check_result(result, 'more than ')
src = 'x = 1'
result = code_server.run_code(src, 'assert x == 1', '/tmp',
- language="python")
+ language="python")
check_result(result, 'correct answer')
result = code_server.run_code(src, 'assert x == 0', '/tmp',
- language="python")
+ language="python")
check_result(result, 'assertionerror')
src = 'abracadabra'
result = code_server.run_code(src, 'assert x == 0', '/tmp',
- language="python")
+ language="python")
check_result(result, 'nameerror')
@@ -202,7 +202,6 @@ def test_java():
int square_num(int a)
{
return a+b
-
"""
result = code_server.run_code(src, 'java_files/main_square.java',
'/tmp', language="java")
@@ -215,40 +214,40 @@ def test_bash():
#!/bin/bash
[[ $# -eq 2 ]] && echo $(( $1 + $2 )) && exit $(( $1 + $2 ))
"""
- result = code_server.run_code(src,
- 'docs/sample.sh\ndocs/sample.args', '/tmp', language="bash")
+ result = code_server.run_code(src, 'docs/sample.sh\ndocs/sample.args',
+ '/tmp', language="bash")
check_result(result)
src = """
#!/bin/bash
[[ $# -eq 2 ]] && echo $(( $1 - $2 )) && exit $(( $1 - $2 ))
"""
- result = code_server.run_code(src,
- 'docs/sample.sh\ndocs/sample.args', '/tmp', language="bash")
+ result = code_server.run_code(src, 'docs/sample.sh\ndocs/sample.args',
+ '/tmp', language="bash")
check_result(result, 'error')
src = """\
#!/bin/bash
while [ 1 ] ; do echo "" > /dev/null ; done
"""
- result = code_server.run_code(src,
- 'docs/sample.sh\ndocs/sample.args', '/tmp', language="bash")
+ result = code_server.run_code(src, 'docs/sample.sh\ndocs/sample.args',
+ '/tmp', language="bash")
check_result(result, 'more than ')
src = '''
#!/bin/bash
while [ 1 ] ; do echo "" > /dev/null
'''
- result = code_server.run_code(src,
- 'docs/sample.sh\ndocs/sample.args', '/tmp', language="bash")
+ result = code_server.run_code(src, 'docs/sample.sh\ndocs/sample.args',
+ '/tmp', language="bash")
check_result(result, 'error')
src = '''# Enter your code here.
#!/bin/bash
while [ 1 ] ; do echo "" > /dev/null
'''
- result = code_server.run_code(src,
- 'docs/sample.sh\ndocs/sample.args', '/tmp', language="bash")
+ result = code_server.run_code(src, 'docs/sample.sh\ndocs/sample.args',
+ '/tmp', language="bash")
check_result(result, 'oserror')
if __name__ == '__main__':