diff options
author | prathamesh | 2014-06-05 11:54:08 +0530 |
---|---|---|
committer | prathamesh | 2014-06-05 11:54:08 +0530 |
commit | 32e019a07de1f9e819e9c1531c50166289c76cb9 (patch) | |
tree | ab43c59e35b2250bb5c4caa8f306d19fadbfe706 /testapp/test_server.py | |
parent | 3d0b69caf6b94a1afe95fef2787929c14afdb485 (diff) | |
parent | fa1cdf5c8f92715f2b3866f0a17e2439d27557c5 (diff) | |
download | online_test-32e019a07de1f9e819e9c1531c50166289c76cb9.tar.gz online_test-32e019a07de1f9e819e9c1531c50166289c76cb9.tar.bz2 online_test-32e019a07de1f9e819e9c1531c50166289c76cb9.zip |
Merge branch 'deploy_server'
Diffstat (limited to 'testapp/test_server.py')
-rw-r--r-- | testapp/test_server.py | 27 |
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__': |