예제 #1
0
    def test_can_ack_messages(self):

        raw_message = amqp.Message(
            ProfileRequest(0, '', '').json(),
            content_type='application/json',
        )
        self._channel.basic_publish(raw_message, routing_key=self._test_id)

        trans = AmqpTransport(
            host='localhost',
            username='******',
            password='******',
            queue=self._test_id,
        )

        message = trans.fetch()
        trans.complete(message)

        self.assertTrue(trans.fetch() is None)
예제 #2
0
    def test_can_ack_messages(self):

        raw_message = amqp.Message(
            ProfileRequest(0, '', '').json(),
            content_type='application/json',
        )
        self._channel.basic_publish(raw_message, routing_key=self._test_id)

        trans = AmqpTransport(
            host='localhost',
            username='******',
            password='******',
            queue=self._test_id,
        )

        message = trans.fetch()
        trans.complete(message)

        self.assertTrue(trans.fetch() is None)