0
我是新來的python和單元測試,我如何寫下面的燒瓶Flask doc上傳,redirect功能的單元測試用例。在此先感謝如何編寫用於上傳,下載Rester服務(瓶)功能的單元測試用例?
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')