#NEWLINE# def test_cache_cluster_basic_apis( redis_hosts ) : #NEWLINE# #INDENT# cache = CacheCluster ( redis_hosts ) #NEWLINE# assert ( cache . get ( 'key' ) is None ) #NEWLINE# assert cache . set ( 'key' , 'value' ) #NEWLINE# assert ( cache . get ( 'key' ) == 'value' ) #NEWLINE# assert cache . delete ( 'key' ) #NEWLINE# assert ( cache . get ( 'key' ) is None ) #NEWLINE# assert ( cache . get_many ( 'key1' , 'key2' ) == [ None , None ] ) #NEWLINE# assert cache . set_many ( { #NEWLINE# #INDENT# 'key1' : 'value1' , #NEWLINE# 'key2' : 'value2' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( cache . get_many ( 'key1' , 'key2' ) == [ 'value1' , 'value2' ] ) #NEWLINE# assert cache . delete_many ( 'key1' , 'key2' ) #NEWLINE# assert ( cache . get_many ( 'key1' , 'key2' ) == [ None , None ] ) #NEWLINE# assert ( cache . get_many ( ) == [ ] ) #NEWLINE# assert cache . set_many ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# assert cache . delete_many ( ) #NEWLINE# assert ( cache . get ( 'key' ) is None ) #NEWLINE# assert cache . set ( 'key' , [ 'value' ] ) #NEWLINE# assert ( cache . get ( 'key' ) == [ 'value' ] ) #NEWLINE# assert cache . delete ( 'key' ) #NEWLINE# assert ( cache . get ( 'key' ) is None )