Google Cloud Storage API Unit Testing

I have an API endpoint in which I am trying to write unit tests and I cannot understand how unit test calls the Google Cloud Storage Python client library ( https://cloud.google.com/appengine/docs/python/googlecloudstorageclient / ). I was hoping to find a stub somewhere in the library, and let it be as simple as unit testing the mail API ( https://cloud.google.com/appengine/docs/python/tools/localunittesting?hl=en ), but haven’t found anything yet. Any idea how to do this?

+7
google-app-engine google-cloud-storage
source share
2 answers

The list of available unit tests does not display GCS . You can submit function requests to their GitHub to add this functionality.

At the same time, using setUp for your tests to create files is probably your best bet.

+1
source share

Add

self.testbed.init_blobstore_stub() 

to your unittests.

-one
source share

All Articles