#NEWLINE# def test_worker_assings_unique_id_to_each_chunk( self ) : #NEWLINE# #INDENT# self . id_generator . set_ids ( [ 0 , 1 ] ) #NEWLINE# self . audio . set_chunks ( [ 'chunk 1' , 'chunk 2' , 'chunk 3' , 'chunk 4' ] ) #NEWLINE# self . vad . set_messages ( [ ( True , None , 'chunk 1' , 'resampled chunk 1' ) , ( False , 'non-speech' , '' , '' ) , ( True , None , 'chunk 2' , 'resampled chunk 2' ) , ( False , 'non-speech' , '' , '' ) ] ) #NEWLINE# messages = [ { #NEWLINE# #INDENT# 'frontend' : self . make_frontend_request ( 'speech 1' , 'ONLINE' , id = 1 , has_next = True ) , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . run_worker ( messages ) #NEWLINE# expected_messages = createResultsMessage ( [ ( 0 , True , [ ( 1.0 , 'Hello World!' ) ] ) , ( 1 , True , [ ( 1.0 , 'Hello World!' ) ] ) ] ) #NEWLINE# self . assertThatMessagesWereSendToFrontend ( [ expected_messages ] )