#NEWLINE# def test_redis_set( self ) : #NEWLINE# #INDENT# 'Test redis set.' #NEWLINE# set_key = ( '%s.list' % self . prefix ) #NEWLINE# rd = RedisDict ( ) #NEWLINE# del rd [ set_key ] #NEWLINE# for class_impl in ( RedisSet , PickleRedisSet , JSONRedisSet ) : #NEWLINE# #INDENT# rs = class_impl ( set_key ) #NEWLINE# self . assertEquals ( len ( rs ) , 0 ) #NEWLINE# rs . add ( 'a' ) #NEWLINE# rs . add ( 'a' ) #NEWLINE# rs . update ( ( 'a' , 'b' ) ) #NEWLINE# self . assertEquals ( len ( self ) , 2 ) #NEWLINE# self . assertTrue ( ( rs . pop ( ) in ( 'a' , 'b' ) ) ) #NEWLINE# self . assertEquals ( len ( rs ) , 1 ) #NEWLINE# self . assertTrue ( ( rs . pop ( ) in ( 'a' , 'b' ) ) ) #NEWLINE# self . assertEquals ( len ( rs ) , 0 )