diff options
author | Jay Parikh | 2012-06-25 17:28:28 +0530 |
---|---|---|
committer | Jay Parikh | 2012-06-25 17:28:28 +0530 |
commit | 1712353f3646e24de7ec359bdbb9c9a3012b1597 (patch) | |
tree | 25aaf810ca401d1f986a31fc3552ed295768f2f3 /testapp/test_server.py | |
parent | 5743fd26a6c844e45a306f9ad5aa589a95c34afe (diff) | |
download | online_test-1712353f3646e24de7ec359bdbb9c9a3012b1597.tar.gz online_test-1712353f3646e24de7ec359bdbb9c9a3012b1597.tar.bz2 online_test-1712353f3646e24de7ec359bdbb9c9a3012b1597.zip |
implemented tabs & line numbers in textarea
Diffstat (limited to 'testapp/test_server.py')
-rw-r--r-- | testapp/test_server.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/testapp/test_server.py b/testapp/test_server.py index be9f876..e81daf2 100644 --- a/testapp/test_server.py +++ b/testapp/test_server.py @@ -35,6 +35,28 @@ def test_python(): language="python") check_result(result, 'nameerror') +def test_c(): + """Test if server runs Python code as expected.""" + src = 'while True: pass' + result = code_server.run_code(src, '', '/tmp', language="c") + check_result(result, 'more than ') + + src = 'x = 1' + result = code_server.run_code(src, 'assert x == 1', '/tmp', + language="c") + check_result(result, 'correct answer') + + result = code_server.run_code(src, 'assert x == 0', '/tmp', + language="c") + check_result(result, 'assertionerror') + + src = 'C lang. Code' + result = code_server.run_code(src, 'assert x == 0', '/tmp', + language="c") + check_result(result, 'nameerror') + + + def test_bash(): """Test if server runs Bash code as expected.""" src = """ @@ -80,4 +102,4 @@ def test_bash(): if __name__ == '__main__': test_python() test_bash() - + test_c() |