#NEWLINE# def test_sink_write( self ) : #NEWLINE# #INDENT# self . my_sink . redis_pipeline . setex = self . stub_setex #NEWLINE# self . my_sink . redis_pipeline . execute = self . stub_execute #NEWLINE# data_tuple = TimeSeriesTuple ( 'service' , 60 , 1.0 ) #NEWLINE# for nr_elements_to_insert in [ 0 , 20 ] : #NEWLINE# #INDENT# redis_value = ( [ RedisTimeStamped ( { #NEWLINE# #INDENT# 'ttl' : 60 , #NEWLINE# #UNINDENT# } , data_tuple ) ] * nr_elements_to_insert ) #NEWLINE# self . my_sink . write ( redis_value ) #NEWLINE# expected_pipeline = ( [ ( 'service:60' , 60 , pickle . dumps ( TimeSeriesTuple ( 'service' , 60 , 1.0 ) ) ) ] * ( nr_elements_to_insert % self . configuration [ 'pipeline_size' ] ) ) #NEWLINE# expect ( self . redis_pipeline_list ) . to . equal ( expected_pipeline )