Пример #1
0
 def test_low_level_succesful_rpc_creation_and_delivering_works(self):
     self.producer.channel.auto_rpc_answer(
         status=True,
         message=messaging.MessageResult(value=True,
                                         message="test_error_message"))
     rpc_answer = self.low_level_rpc_helper()
     self.producer.channel.auto_rpc_answer(status=False)
     self.assertTrue(rpc_answer.body['content']['value'])
Пример #2
0
 def test_low_level_rpc_queue_is_correct(self):
     self.producer.channel.auto_rpc_answer(
         status=True,
         message=messaging.MessageResult(value=True,
                                         message="test_error_message"))
     rpc_queue = self.producer._rpc_send(3,
                                         'test',
                                         adict={'number': 25},
                                         _key="a_test_routing_key",
                                         _queue_only=True,
                                         _callable=messaging.Message)
     rpc_answer = self.low_level_rpc_helper()
     self.producer.channel.auto_rpc_answer(status=False)
     self.assertTrue(rpc_queue)
Пример #3
0
 def msg_echo(self, content, reply_func):
     print content['parameters']
     reply_func(messaging.MessageResult("RPC message received"))
Пример #4
0
 def setUp(self):
     self.message = messaging.MessageResult('test_value', 'test_message')
Пример #5
0
 def msg_rpc_ping(self, content, reply_func):
     print "Got a ping! Answering..."
     reply_func(messaging.MessageResult('Pong'))