Imagine a class like so:
class Foo():
def method_1(self):
bar = Bar()
bazz = Bazz(bar)
return bazz.method_2()
For unit testing, how can we mock the Bar
object when we never call any methods on it, we're just passing it as a parameter to the Bazz
constructor? (Yes, this is not ideal, but this pattern can be found in a top-level class wiring together different objects via dependency injection).