All About MockSession

Contrary to what one might expect, the MockSession class is pretty easy to understand. MockSession is a subclass of the Sequence class and inherits most of its functionality from it. There are some important differences, though:

  • The very first MockSession instance created sets itself as the "active session" for svnmock. The active session is the MockSession object that is used to validate incoming API function calls.

    If you need to change the active session, you can invoke the make_active() method of the desired MockSession instance. This method will make its invocant active, plus return the former active session.

  • MockSession overrides Sequence.__call__. Since it doesn't make sense for MockSession objects to be contained in other Containers, MockSession.__call__ does not follow the Container protocol in this respect.

svnmock