Mock from python is really useful, when comes to testing. I have being in projects that the CI actually used the Google Cloud to run tests, a waste of money. Let’s make some examples on how mock the google cloud api and how to learn the most important topic related to mock: THE FUCKING PATH (spent so many time with this):
Let’s imagine this situation: you create a separated file to handle google-cloud functions, and your app import it.
Let’s mock it from test_app.py:
Keep in mind that when mocking, you need to target the environment that things are running. I usually try to follow the file that I’m using and then I choose the import.