单元测试Google的Cloud Storage API [英] Unit testing Google's Cloud Storage API
问题描述
我有一个API端点,我正在尝试编写单元测试,我似乎无法弄清楚如何单元测试Python Google Cloud Storage客户端库调用( https://cloud.google.com/appengine/docs/python/googlecloudstorageclient/ )。
我希望在库中的某个地方找到一个存根,并且像单元测试一样简单,邮件API就是( https://cloud.google.com/appengine/docs/python/tools/localunittesting?hl=zh_CN ),但未发现任何内容然而。任何想法如何去做这件事?
同时,使用setUp进行测试来创建文件可能是您最好的选择。
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?
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.
这篇关于单元测试Google的Cloud Storage API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!