#NEWLINE# @ patch ( 'kombu.common.itermessages' ) #NEWLINE# def test_collect_replies_with_ack( self , itermessages ) : #NEWLINE# #INDENT# ( conn , channel , queue ) = ( Mock ( ) , Mock ( ) , Mock ( ) ) #NEWLINE# ( body , message ) = ( Mock ( ) , Mock ( ) ) #NEWLINE# itermessages . return_value = [ ( body , message ) ] #NEWLINE# it = collect_replies ( conn , channel , queue , no_ack = False ) #NEWLINE# m = next ( it ) #NEWLINE# self . assertIs ( m , body ) #NEWLINE# itermessages . assert_called_with ( conn , channel , queue , no_ack = False ) #NEWLINE# message . ack . assert_called_with ( ) #NEWLINE# with self . assertRaises ( StopIteration ) : #NEWLINE# #INDENT# next ( it ) #NEWLINE# #UNINDENT# channel . after_reply_message_received . assert_called_with ( queue . name )