title: Python unit test mock, get mocked function's input arguments
body: <p>I want a unit test to assert that a variable <code>action</code> within a function is getting set to its expected value, the only time this variable is used is when it is passed in a call to a library. </p>
  
  <pre><code>Class Monolith(object):
      def foo(self, raw_event):
          action =  # ... Parse Event
          # Middle of function
          lib.event.Event(METADATA, action)
          # Continue on to use the build event.
  </code></pre>
  
  <p>My thought was that I could mock <code>lib.event.Event</code>, and get its input arguments and assert they are of specific value. </p>
  
  <p>>Is this not how mocks work? The mock documentation frustrates me with its inconsistency, half-examples, and plethora of examples that are not related to what I want to do.</p>