我是 python 和单元测试的新手,我如何为下面的烧瓶Flask 文档上传、重定向功能编写单元测试用例。提前致谢
from flask import request
@app.route('/upload', methods=['GET', 'POST'])
def upload_file():
if request.method == 'POST':
f = request.files['the_file']
f.save('/uploaded_file.txt')