title: python mock assert_called_with
body: <p>I'm trying to understand the <code>assert_called_with</code> within mock but the code I wrote throws some error.</p>
  
  <pre class="lang-py prettyprint-override"><code>import os
  import twitter
  
  URL = "http://test.com"
  
  def tweet(api, message):
      if len(message) &gt; 40:
          message = message.strip("?.,.,.")
  
      status = api.PostUpdate(message)
      return status
  
  def main():
      api = twitter.Api(consumer_key=''
                      ,consumer_secret='')
      msg = 'This is test message'
      tweet(api, msg)
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p><strong>unittest</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>import unittest
  from mock import Mock
  import test
  
  class TweetTest(unittest.TestCase):
      def test_example(self):
          mock_twitter = Mock()        
          test.tweet(mock_twitter,'msg')        
          mock_twitter.PostUpdate.assert_called_with('message')        
  
  if __name__ == '__main__':
      unittest.main()
  </code></pre>
  
  <p>I'm trying to understand what <code>assert_called_with</code> does here?</p>