title: Python mocking shutils always passes
body: <p>I have a module with many utility functions, most of which exec system calls.  One example is a function that copies a file to a new directory and returns the path.  I am writing unit tests for my utility module and am using mock.  However, while trying to mock <code>shutil.copy2</code> my unit test always passes. </p>
  
  <p>the utility function</p>
  
  <pre><code>import os
  from shutil import copy2
  
  def cp_and_return_path(src, dst):
      """copy a file to a destination and return the destination path."""
      if os.path.isfile(src):
          copy2(src, config.TMP_DIR)
      return dst
  </code></pre>
  
  <p>and the unit test: inside of the class <code>UtilsTest(unittest2.TestCase)</code>. </p>
  
  <pre><code>import mock
  import unittest2
  
  from lib import utils
  ...
  @mock.patch('utils.os')
  @mock.patch('utils.copy2')
  def test_cp_and_return_path(self, mock_copy, mock_os):
      mock_os.path.isfile.return_value = False
      utils.cp_and_return_path('file1', 'test/here')
      self.assertFalse(mock_copy.called)
  </code></pre>
  
  <p>this test passes even when i set the <code>isfile.return_value</code> to <code>True</code>. I am new to mock so perhaps I am missing something. </p>