def view_output(self):
"""
Returns the output_file of testcase
specified in GET request
"""
try:
id = int(self.get_argument('id'))
session = self.acquire_sql_session()
testcase = TestcaseRepository.get_by_id(session, id)
except MissingArgumentError:
raise HTTPError(404, 'No id specified')
except SQLAlchemyError:
raise HTTPError(500, 'Database error, could not find specified id')
except:
raise HTTPError(500, 'Shit happened')
# Sends the actual file data
self.write(testcase.output_file)
session.close()
评论列表
文章目录