title: Assert call to method using Mock python
body: <p>I am trying to do some unit testing using the mock library in Python. I have the following code:</p>
  
  <pre><code>def a():
      print 'a'
  
  def b():
      print 'b'
      if some condition
          a()
  </code></pre>
  
  <p>How do I assert that a call for <code>b</code> has been made when a mock call to <code>b</code> has been made? I have tried the following code, but it failed:</p>
  
  <pre><code>mymock=Mock()
  mymock.b()
  assertTrue(a.__call__ in mymock.mock_calls)
  </code></pre>
  
  <p>For some reason, I think that the <code>mymock.b()</code> has nothing to do with the method <code>b()</code>. What can be done for this?</p>