I need to mock a function(this_function()), that is called inside another function(receive()), inside a function blueprint, inside a class A. How can I do it? I create a mock for this_function() in the file where i have all tests.
class A:
def blueprint():
@route("/", method = ["POST"])
async def receive():
....
test = await this_function()
I created a mock function in the same file as my test:
def mock_this_function():
return ..
class Tests(unittest.TestCase):
@patch("path.to.classA.this_function")
def test(mock_this_function):
This_function is defined in a helper.py module.
I'm not able to connect/use mock_this_function. It always connect me with this_function... Any solution? any Tips how to properly mock it?