title: Mocking functions with FlexMock in Python?
body: <p>I know how to mock methods in Python using flexmock, like</p>
  
  <pre><code> flexmock(subprocess).should_receive('call').replace_with(my_func)
  </code></pre>
  
  <p>How does one mock functions outside objects, or for example <code>glob</code>, which was imported via <code>from glob import glob</code> instead of <code>import glob</code>?</p>
  
  <p>I have found <a href="https://stackoverflow.com/questions/5286390/mocking-functions-using-python-mock">mocking functions using python mock</a> as a similar question, but it doesn't answer my question.</p>