title: How to test if another class method is called within a method in python?
body: <p>I have the following structure:</p>
  <pre><code>ClassB():
     def foo():
  
  Class A():
     def __init__(self, B):
         #some initialisations
     def method1():
         #complex logic
         B.foo()
  </code></pre>
  <p>I am trying to write a unit test method1 and would like to test if foo is called once or not.
  How I can achieve this? What should I mock?</p>