test function with Google App Engine `files` api

前端 未结 3 1532
借酒劲吻你
借酒劲吻你 2021-02-13 17:13

I have a function that uses the Google Blobstore API, and here\'s a degenerate case:

#!/usr/bin/python
from google.appengine.ext import testbed

def foo():
    f         


        
3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-13 17:53

    I don't know if it was added later to the SDK, but using Testbed.init_files_stub should fix it:

    tb = testbed.Testbed()
    tb.activate()
    tb.init_blobstore_stub()
    tb.init_files_stub()
    

提交回复
热议问题