#NEWLINE# def testMemcacheWrappedSet( self ) : #NEWLINE# #INDENT# 'Test BaseModel.MemcacheWrappedSet().' #NEWLINE# self . mox . StubOutWithMock ( models , 'memcache' , True ) #NEWLINE# self . mox . StubOutWithMock ( models . BaseModel , 'kind' ) #NEWLINE# self . mox . StubOutWithMock ( models . BaseModel , 'get_or_insert' ) #NEWLINE# self . mox . StubOutWithMock ( models . db , 'model_to_protobuf' , True ) #NEWLINE# mock_entity = self . mox . CreateMockAnything ( ) #NEWLINE# memcache_entity_key = 'mwg_kind_key' #NEWLINE# memcache_key = 'mwgpn_kind_key_prop' #NEWLINE# models . BaseModel . kind ( ) . AndReturn ( 'kind' ) #NEWLINE# models . BaseModel . kind ( ) . AndReturn ( 'kind' ) #NEWLINE# models . BaseModel . get_or_insert ( 'key' ) . AndReturn ( mock_entity ) #NEWLINE# mock_entity . put ( ) #NEWLINE# models . db . model_to_protobuf ( mock_entity ) . AndReturn ( mock_entity ) #NEWLINE# mock_entity . SerializeToString ( ) . AndReturn ( 'serialized' ) #NEWLINE# models . memcache . set ( memcache_key , 'value' , models . MEMCACHE_SECS ) . AndReturn ( None ) #NEWLINE# models . memcache . set ( memcache_entity_key , 'serialized' , models . MEMCACHE_SECS ) . AndReturn ( None ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# models . BaseModel . MemcacheWrappedSet ( 'key' , 'prop' , 'value' ) #NEWLINE# self . mox . VerifyAll ( )