diff options
author | Prabhu Ramachandran | 2014-06-05 17:56:34 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2014-06-05 17:56:34 +0530 |
commit | 69c114dde3df17a8fd688809beee262f9c274a8d (patch) | |
tree | 8f385a3e36fc86b9237107f67122362c49220082 /testapp/test_server.py | |
parent | 3d0b69caf6b94a1afe95fef2787929c14afdb485 (diff) | |
parent | 18cd0fa1def34bb320f38062596789f745bee530 (diff) | |
download | online_test-69c114dde3df17a8fd688809beee262f9c274a8d.tar.gz online_test-69c114dde3df17a8fd688809beee262f9c274a8d.tar.bz2 online_test-69c114dde3df17a8fd688809beee262f9c274a8d.zip |
Merge pull request #16 from prathamesh920/deploy_server
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__': |