Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit testing Google's Cloud Storage API

I have an API endpoint I'm trying to write unit tests for and I can't seem to figure out how to unit test the Python Google Cloud Storage client library calls (https://cloud.google.com/appengine/docs/python/googlecloudstorageclient/). I was hoping to find a stub somewhere in the library and have it be as simple as unit testing the mail API would be (https://cloud.google.com/appengine/docs/python/tools/localunittesting?hl=en), but haven't found anything yet. Any idea how to go about this?

like image 265
Brandon Avatar asked Sep 16 '15 16:09

Brandon


People also ask

How do I test my Google Cloud Platform?

In the Google Cloud console, from the service project, go to the Connectivity Tests page. Select Create Connectivity Test. Enter a name for the test.

Is Google Cloud Storage API free?

Pricing. All use of the Drive API is available at no additional cost.

What is Google storage Apis?

The Google Drive API allows you to create apps that leverage Google Drive cloud storage. You can develop applications that integrate with Drive, and create robust functionality in your application using the Drive API.


1 Answers

The list of available unit test does not list GCS. You can file a feature request on their GitHub to add that functionality.

In the mean time using the setUp for your tests to create files is probably your best bet.

like image 95
Ryan Avatar answered Sep 21 '22 17:09

Ryan