I am trying to mock the http response for the build.discovery call as outlined in this example:
However, I cannot figure out how to generate the books-discovery.json. When I make the call for realz I get a googleapiclient.discovery.Resource object, which doesn't have any methods for converting into JSON.
Code snippet:
self.__http = Http()
self.__http = HttpMock(
os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tests', 'discovery.json'), # how do I generate this?
{'status': '200'}
)
result = discovery.build('androidpublisher', 'v2', http=self.__http)
Any advice would be appreciated!
Ross