#NEWLINE# def test_publish( self ) : #NEWLINE# #INDENT# msg_mock = mock . MagicMock ( ) #NEWLINE# msg_data = 'msg-data' #NEWLINE# msg_mock . to_dict . return_value = msg_data #NEWLINE# routing_key = 'routing-key' #NEWLINE# task_uuid = 'task-uuid' #NEWLINE# p = self . proxy ( reset_master_mock = True ) #NEWLINE# p . publish ( msg_mock , routing_key , correlation_id = task_uuid ) #NEWLINE# mock_producer = mock . call . connection . Producer ( ) #NEWLINE# master_mock_calls = self . proxy_publish_calls ( [ mock_producer . __enter__ ( ) . publish ( body = msg_data , routing_key = routing_key , exchange = self . exchange_inst_mock , correlation_id = task_uuid , declare = [ self . queue_inst_mock ] , type = msg_mock . TYPE , reply_to = None ) ] , routing_key ) #NEWLINE# self . master_mock . assert_has_calls ( master_mock_calls )