There are numerous posts detailing how people use google cloud storage with google app engine and are able to test GCS locally 1 2.
Furthermore the Google docs are frustratingly inconsistent. Example:
You can use the client library with the development server. However because there is no local emulation of Cloud Storage, all requests to read and write files must be sent over the Internet to an actual Cloud Storage bucket.
--storage_path=...
Path at which all local files, such as the Cloud Datastore, Blobstore, Cloud Storage files and logs, will be stored, unless overridden by --datastore_path, --blobstore_path, or --logs_path.
I have not been able to store blobs locally. My simplified code looks like this:
from google.cloud import storage
client = storage.Client()
bucket = client.get_bucket('test_bucket')
blob = bucket.blob('my_blob_name')
blob.upload_from_string('my blob text')
Moreover people have indicated 1 2 that you can do unittesting by stubbing out the Google Cloud Store with the following call to the testbed (link to unittesting docs):
testbed.init_blobstore_stub()
or registering a cloud storage stub:
from google.appengine.ext.cloudstorage import cloudstorage_stub
from google.appengine.api.blobstore.dict_blob_storage import DictBlobStorage
blob_storage = DictBlobStorage()
storage_stub = cloudstorage_stub.CloudStorageStub(blob_storage)
tb._register_stub('cloudstorage', storage_stub)
Neither of these have worked for me. Has anyone successfully navigated Google's byzantine docs and know how to use the GAE local development server to emulate GCS and/or stub out GCS for code testing?