Example #1
0
    def setUp(self):
        super(TestProcessReceiver, self).setUp()

        self.connector = rmq.RmqConnector('amqp://*****:*****@localhost:5672/', loop=self.loop)
        exchange_name = "{}.{}".format(self.__class__.__name__, uuid.uuid4())

        self.communicator = rmq.RmqCommunicator(
            self.connector,
            exchange_name=exchange_name,
            testing_mode=True,
        )

        self.communicator.init()
Example #2
0
    def create_communicator(self):
        self.connector = rmq.RmqConnector('amqp://*****:*****@localhost:5672/',
                                          loop=self.loop)
        self.exchange = "{}.{}".format(self.__class__.__name__, uuid.uuid4())
        self.task_queue = "{}.{}".format(self.__class__.__name__, uuid.uuid4())

        communicator = rmq.RmqCommunicator(self.connector,
                                           exchange_name=self.exchange,
                                           task_queue=self.task_queue,
                                           testing_mode=True)

        communicator.connect()
        return communicator
Example #3
0
    def setUp(self):
        super(TestCommunicatorDroppyConnection, self).setUp()

        self.connector = rmq.RmqConnector('amqp://*****:*****@localhost:5672/',
                                          loop=self.loop)
        self.exchange = "{}.{}".format(self.__class__.__name__, uuid.uuid4())
        self.task_queue = "{}.{}".format(self.__class__.__name__, uuid.uuid4())

        self._communicator = rmq.RmqCommunicator(self.connector,
                                                 exchange_name=self.exchange,
                                                 task_queue=self.task_queue,
                                                 testing_mode=True)

        self._communicator.connect()
Example #4
0
    def setUp(self):
        super(TestTaskPublisher, self).setUp()
        self.connector = rmq.RmqConnector('amqp://*****:*****@localhost:5672/',
                                          loop=self.loop)
        self.exchange_name = "{}.{}".format(self.__class__.__name__,
                                            uuid.uuid4())
        self.task_queue = "{}.{}".format(self.__class__.__name__, uuid.uuid4())

        self.task_publisher = rmq.RmqTaskPublisher(
            self.connector,
            task_queue_name=self.task_queue,
            exchange_name=self.exchange_name,
            testing_mode=True)

        self.loop.run_sync(self.task_publisher.connect)
Example #5
0
    def setUp(self):
        super(TestTaskControllerAndRunner, self).setUp()

        self.connector = rmq.RmqConnector('amqp://*****:*****@localhost:5672/', loop=self.loop)
        self.exchange_name = "{}.{}".format(self.__class__.__name__, uuid.uuid4())
        self.queue_name = "{}.{}.tasks".format(self.__class__.__name__, uuid.uuid4())

        self.subscriber = rmq.RmqTaskSubscriber(
            self.connector,
            exchange_name=self.exchange_name,
            task_queue_name=self.queue_name,
            testing_mode=True)
        self.publisher = rmq.RmqTaskPublisher(
            self.connector,
            exchange_name=self.exchange_name,
            task_queue_name=self.queue_name,
            testing_mode=True)

        self.loop.run_sync(lambda: self.subscriber.connect())
        self.loop.run_sync(lambda: self.publisher.connect())