def generate_diff(test_id, regression_test_id, output_id):
from run import config
if request.is_xhr:
# Fetch test
result = TestResultFile.query.filter(and_(
TestResultFile.test_id == test_id,
TestResultFile.regression_test_id == regression_test_id,
TestResultFile.regression_test_output_id == output_id)).first()
if result is not None:
path = os.path.join(
config.get('SAMPLE_REPOSITORY', ''), 'TestResults')
return result.generate_html_diff(path)
abort(404)
abort(403, 'generate_diff')
评论列表
文章目录