test function with Google App Engine `files` api

前端 未结 3 1461
借酒劲吻你
借酒劲吻你 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-13 17:29

    Any chance that you are trying to do this using the gaeunit.py test runner? I see the same error while using that, since it does it's own code to replace the api proxy.

    The error disappears when I added 'file' to the "as-is" list of proxies in the _run_test_suite function of gaeunit.py.

    Honestly, I'm not sure that the gaeunit.py proxy replacement code is needed at all since I'm also using the more recently recommended testbed code in the test cases as per http://code.google.com/appengine/docs/python/tools/localunittesting.html. So, at this point I've commented it all out of gaeunit.py, which also seems to be working.

    Note that I'm doing all this on a dev server only, in highly experimental mode on python27 in GAE with Python 2.7.

    Hope this helps.

提交回复
热议问题