Karellen is the future of DevOps.
More coming soon.
You have a class whose API you want to verify: [python] class Class_A(object): def method_X(self): self.method_Y() def method_Y(self): pass [/python] You write the following test fully expecting it to pass. Alas, the method_Y assertion fails. [python] def test_class_a(self): obj = Class_A() mock = MagicMock(spec_set=obj, wraps=obj) mock.method_X() mock.method_Y.assert_called_once_with() [/python] This is because the Python Unittest Mock, … Continue reading “How to spy on Mock-wrapped method calls in Python”