How to mock just the method inside the class
问题 Trying to write a testcase for my class based function. This is skeleton of my class class Library(object): def get_file(self): pass def query_fun(self): pass def get_response(self): self.get_file() response = self.query_fun() # some business logic here return response I need to create a testcase that can mock just the query_fun and do the rest. tried below but seems is not the right direction: from unittest import mock, TestCase from library.library import Library class TestLibrary(TestCase)