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'])
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)
def msg_echo(self, content, reply_func): print content['parameters'] reply_func(messaging.MessageResult("RPC message received"))
def setUp(self): self.message = messaging.MessageResult('test_value', 'test_message')
def msg_rpc_ping(self, content, reply_func): print "Got a ping! Answering..." reply_func(messaging.MessageResult('Pong'))