summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprathamesh2013-07-03 14:10:51 +0530
committerprathamesh2013-07-03 14:10:51 +0530
commit7b18a329a2692d3f85fbe71fa99ceee9838b85c8 (patch)
tree6104cea3d6682e8d101da7f44ad645e7e00fc4f1
parent781842c523ccf11b85e0be06e884b2cd585f3cb9 (diff)
downloadonline_test-7b18a329a2692d3f85fbe71fa99ceee9838b85c8.tar.gz
online_test-7b18a329a2692d3f85fbe71fa99ceee9838b85c8.tar.bz2
online_test-7b18a329a2692d3f85fbe71fa99ceee9838b85c8.zip
variable name changed
-rwxr-xr-xtestapp/code_server.py8
-rw-r--r--testapp/test_server.py1
2 files changed, 5 insertions, 4 deletions
diff --git a/testapp/code_server.py b/testapp/code_server.py
index a3513b7..c853753 100755
--- a/testapp/code_server.py
+++ b/testapp/code_server.py
@@ -399,11 +399,11 @@ class CodeServer(object):
output_path = os.getcwd() + '/output'
compile_command = "g++ %s -c -o %s" % (submit_code_path, output_path)
ret = self._compile_command(compile_command)
- proc, inst_stderr = ret
+ proc, stdnt_stderr = ret
# Only if compilation is successful, the program is executed
# And tested with testcases
- if inst_stderr == '':
+ if stdnt_stderr == '':
executable = os.getcwd() + '/executable'
compile_main = "g++ %s %s -o %s" % (ref_code_path, output_path,
executable)
@@ -432,14 +432,14 @@ class CodeServer(object):
else:
err = "Compilation Error:"
try:
- error_lines = inst_stderr.splitlines()
+ error_lines = stdnt_stderr.splitlines()
for e in error_lines:
if ':' in e:
err = err + "\n" + e.split(":", 1)[1]
else:
err = err + "\n" + e
except:
- err = err + "\n" + inst_stderr
+ err = err + "\n" + stdnt_stderr
return success, err
def run_cplus_code(self, answer, test_code, in_dir=None):
diff --git a/testapp/test_server.py b/testapp/test_server.py
index 924a6c5..5c88d73 100644
--- a/testapp/test_server.py
+++ b/testapp/test_server.py
@@ -16,6 +16,7 @@ def check_result(result, check='correct answer'):
assert result[0], result[1]
assert check in result[1].lower(), result[1]
+
def test_python():
"""Test if server runs Python code as expected."""
src = 'while True: pass'