How can one test appengine/drive/google api based applications?
-
15-07-2021 - |
Question
There are several components involved in auth and the discovery based service api.
How can one test request handlers wrapped with decorators used from oauth2client (eg oauth_required, etc), httplib2, services and uploads?
Are there any commonly available mocks or stubs?
Solution
There are the mock http and request classes that the apiclient package uses for its own testing. They are in apiclient/http.py and you can see how to use them throughout the test suite.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow