title: Testing call order across mock objects with Mox and Python
body: <p>I'm testing a function that obtains a skeleton object from one helper object, modifies it using a second helper, and passes the modified object back to the first helper. Something along the lines of:</p>
  
  <pre><code>class ReadModifyUpdate(object):
      def __init__(self, store, modifier):
          self._store = store
          self._modifier = modifier
  
      def modify(key):
          record = self._store.read(key)
          self._modifier.modify(record)
          self._store.update(key, record)
  </code></pre>
  
  <p>Using Python and Mox, we can test this with:</p>
  
  <pre><code>class ReadModifyUpdateTest(mox.MoxTestBase):
      def test_modify(self):
          mock_record = self.mox.CreateMockAnthing()
          mock_store = self.mox.CreateMockAnything()
          mock_modifier = self.mox.CreateMockAnything()
  
          mock_store.read("test_key").AndReturn(mock_record)
          mock_modifier.modify(mock_record)
          mock_store.update("test_key", mock_record)
          self.mox.ReplayAll()
  
          updater = ReadModifyUpdate(mock_store, mock_modifier)
          updater.modify("test_key")
  </code></pre>
  
  <p>...but this doesn't catch the bug in which store.update() is inadvertently called before modifier.modify(). Is there a good way, in Mox, to check the order of methods called on multiple mocks? Something like EasyMock's MocksControl object?</p>