コード例 #1
0
ファイル: test_client.py プロジェクト: heytrav/rabbit-qurator
 def test_task_properties(self):
     """Setup task properties."""
     c = RpcClient()
     c._send_command = MagicMock()
     c.task('whatever', {"data": "x"})
     c._send_command.assert_called_with(ANY,
                                        'whatever',
                                        declare_queue=False)
     # This part shouldn't matter if legacy or not.
     c = RpcClient(client_queue='test.my.queue')
     c._send_command = MagicMock()
     c.task('whatever', {"data": "x"})
     c._send_command.assert_called_with(ANY,
                                        'whatever',
                                        declare_queue=False)
コード例 #2
0
ファイル: test_client.py プロジェクト: heytrav/rabbit-qurator
 def test_task_properties(self):
     """Setup task properties."""
     c = RpcClient()
     c._send_command = MagicMock()
     c.task('whatever', {"data": "x"})
     c._send_command.assert_called_with(
         ANY,
         'whatever',
         declare_queue=False
     )
     # This part shouldn't matter if legacy or not.
     c = RpcClient(client_queue='test.my.queue')
     c._send_command = MagicMock()
     c.task('whatever', {"data": "x"})
     c._send_command.assert_called_with(
         ANY,
         'whatever',
         declare_queue=False
     )
コード例 #3
0
ファイル: mailer_test.py プロジェクト: heytrav/rabbit-qurator
import time
from kombu import Exchange as task_exchange
from qurator.rpc.client import RpcClient

if __name__ == '__main__':
    client = RpcClient(exchange=task_exchange)
    reply = client.task('missing_handle', 
               {'user_id': "4084a589401ebe665c313edecf001fcb"},
               server_routing_key='api.mailer')
    print("Got reply: {!r}".format(reply))



コード例 #4
0
import time
from kombu import Exchange as task_exchange
from qurator.rpc.client import RpcClient

if __name__ == '__main__':
    client = RpcClient(exchange=task_exchange)
    reply = client.task('missing_handle',
                        {'user_id': "4084a589401ebe665c313edecf001fcb"},
                        server_routing_key='api.mailer')
    print("Got reply: {!r}".format(reply))