-
Looking at https://github.com/googleapis/google-api-python-client/blob/main/docs/mocks.md i see that i need some json representation of the services. I try to mock service accounts and i do not know where to find those files. in my case, i want to mock for instance
Taking the example i have
Where can i find the representation of |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Hi @b10n1k! For 'service_account_discovery.json' and
Note, if you change
to
in your testing. You won't need to mock building of the client as the default behaviour for |
Beta Was this translation helpful? Give feedback.
-
i changed the build() as suggested however the test breaks
|
Beta Was this translation helpful? Give feedback.
-
regarding
Could you provide an example for catch the response for the actual |
Beta Was this translation helpful? Give feedback.
-
Here is a working example with mock:
The contents of
|
Beta Was this translation helpful? Give feedback.
Hi @b10n1k!
For 'service_account_discovery.json' and
iam_accounts.json
you would need to create those files based on the actual API responses. Please see the 2nd note listed under the example.Note, if you change
to
in your testing. You won't need to mock building of the client as the default behaviour for
googleapiclient.discovery.build()
is to fetch discovery artifacts which are shipped with the library rather th…