python - how to simulate image upload to google app engine blobstore -
i'm uploading images gae blobstore using create_upload_url
uploadurl = blobstore.create_upload_url('/upload')
for purpose of unit testing gae code, can simulate image upload? or should insert image data in test bed , assume upload successful? if so, how upload image test bed?
agree @fredrik on you're testing there.
anyway, if you're doing functional/blackbox/similar testing, use webtest framework (see post
method) , actual upload, e.g.
payload = [(fieldname, filename)] test_app.post(uploadurl, upload_files=payload)
have @ handler testing python details on how initialize above test_app.
Comments
Post a Comment