title: Python class mock. How can I get mock-class method calls information
body: <p>I have a class named <em>Client</em> providing some service by its <em>getResponse</em> method. This class is used by other classes.
  I make unit testing for class <em>Driver</em> who uses the <em>Client</em> class.
  By using mock.patch, I replace the <em>Client</em> class by mock class called <em>MockClient</em>
  which has the same <em>getResponse</em> method returning some predefined values.
  It works great. But now I want to test parameters the <em>getRsponse</em> method was called with.
  I want to do it by using the *assert_has_calls* method.
  Did not find how to do it. Please advice.</p>
  
  <p>Class under test:</p>
  
  <pre><code># Driver and its Client
  
  class Driver:
      def __init__ (self):
          self.client = Client()
  
      def call(self, param):
          return self.client.getResponse(param)
  
  
  class Client:
      def getResponse(self, param):
          return 'original'
  </code></pre>
  
  <p>This is the Test class with the mock class:</p>
  
  <pre><code>import unittest
  import mock
  
  import driver
  from driver import Driver 
  from driver import Client
  
  
  class MockClient:
      def getResponse(self,param):
          return 'mock class' 
  
  
  class TestIt(unittest.TestCase):
  
      def setUp(self):
          self.mock_client = mock.patch('driver.Client',create=True, new=MockClient)
          self.mock_client.start()
  
      def tearDown(self):
          self.mock_client.stop()
  
      def test_call(self):
          driver = Driver()
          result = driver.call('test')
          self.assertEqual(result, 'mock class')
  </code></pre>