title: Mocking objects in Python
body: <p>I'm new to Unit testing and mocking objects in Python. I have a function that I need to create a unit test for.</p>
  
  <pre><code>def BuildBall(self, material):
    """Create a Ball from material."""
    result = {}
    for b in xrange(material.ball_size()):
      ball = material.ball(b)
      result[ball.name()] = (ball.name(), ball.description())
    return result
  </code></pre>
  
  <p>I want to create a dummy object(material) and pass it to BuildBall(), so that I can predict what the result will look like in my unit test.</p>
  
  <p>I'm not too sure how I can pass a dummy object to my method in this case. Any idea if I can use mox to create a dummy object in my case?</p>
  
  <p>Thanks in advance</p>