':py:obj:`Context.set_session_cache_mode` specifies how sessions are
cached.  The setting can be retrieved via
:py:obj:`Context.get_session_cache_mode`.'

def test_session_cache_mode(self):

    context = Context(TLSv1_METHOD)
    context.set_session_cache_mode(SESS_CACHE_OFF)
    off = context.set_session_cache_mode(SESS_CACHE_BOTH)
    self.assertEqual(SESS_CACHE_OFF, off)
    self.assertEqual(SESS_CACHE_BOTH, context.get_session_cache_mode())
