#NEWLINE# def test_pickleable( self ) : #NEWLINE# #INDENT# cache = LRUCache ( 2 ) #NEWLINE# cache [ 'foo' ] = 42 #NEWLINE# cache [ 'bar' ] = 23 #NEWLINE# cache [ 'foo' ] #NEWLINE# for protocol in range ( 3 ) : #NEWLINE# #INDENT# copy = pickle . loads ( pickle . dumps ( cache , protocol ) ) #NEWLINE# assert ( copy . capacity == cache . capacity ) #NEWLINE# assert ( copy . _mapping == cache . _mapping ) #NEWLINE# assert ( copy . _queue == cache . _queue )