I have a certain piece of code that looks like this:
# file1.py
from module import Object
def method():
o = Object("param1")
o.do_something("param2")
I have unittests that look like this:
@patch("file1.Object")
class TestFile(unittest.TestCase):
def test_call(self, obj):
...
I can do obj.assert_called_with() in the unittest to verify that the constructor was called with certain parameters. Is it possible to verify that obj.do_something was called with certain parameters? My instinct is no, as the Mock is fully encapsulated within Object, but I was hoping there might be some other way.