diff options
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__': |