Apologies in advance for what may be a newbie python dev question
I have a function that creates a deepgram client, calls the transcribe_url function, and returns the json representation of the response (to_json). I am trying to use unittest mocks to patch the deepgram client and the transcribe_url function, but I'm having a hard time figuring out how to do this when the transcribe_url function is accessed in a chain of functions like deepgram.listen.prerecorded.v("1").transcribe_url.
Mocking the DeepgramClient is straightforward, but I'm not able to patch the transcribe_url.to_json response so I can assert it works. Is there a better way of setting up transcribe_url so its patchable, or am I missing some unittest mock syntax that would let me patch a deep call?