mercredi 4 mars 2015

Unit testing BlobStore create_upload_url uploads

I'm using the using the GAE BlobStore API to create an upload URL, as follows:



self.response.write(blobstore.create_upload_url(....))


Everything works fine in production, but when using testbed to unit test this API, I get the following URL back:



http://ift.tt/1DMfjgs


Uploading to this URL from the test doesn't work, I get a 404. I should have initialized all stubs properly, amongst others:



self.testbed.init_datastore_v3_stub()
self.testbed.init_blobstore_stub()
self.testbed.init_files_stub()


What am I doing wrong? How do I unit test file uploads using the blobstore create_upload_url API?


Aucun commentaire:

Enregistrer un commentaire