TestcaseHandler.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:mlc 作者: valiro21 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号