Skip to main content

automatically setups a rabbitmq server instance for use in tests

Project description

About

testing.rabbitmq automatically setups a rabbitmq instance, and destroys it after testing.

https://travis-ci.org/tristan/testing.rabbitmq.svg?branch=master https://coveralls.io/repos/tristan/testing.rabbitmq/badge.png?branch=master https://codeclimate.com/github/tristan/testing.rabbitmq/badges/gpa.svg
Documentation
https://github.com/tristan/testing.rabbitmq
Issues
https://github.com/tristan/testing.rabbitmq/issues
Download
https://pypi.python.org/pypi/testing.rabbitmq

Install

Use pip:

$ pip install testing.rabbitmq

And testing.rabbitmq requires rabbitmq-server and rabbitmqctl at /usr/lib/rabbitmq/bin. If rabbitmq is installed at a different path set rabbitmq_script_dir when creating the RabbitMQServer instance.

Usage

Create RabbitMQServer instance using testing.rabbitmq.RabbitMQServer:

import testing.rabbitmq
import pika

# Lanuch new Parity-Ethereum server
with testing.rabbitmq.RabbitMQServer() as rmq:
    connection = pika.BlockingConnection(
        pika.ConnectionParameters(**rmq.dsn()))
    channel = connection.channel()
    channel.basic_publish(exchange='',
                          routing_key='test',
                          body=b'Test message.')
    connection.close()

# Rabbitmq server is terminated here

Requirements

  • Python 2.7, 3.4, 3.5, 3.6

License

Apache License 2.0

History

1.0.0 (2019-08-19)

  • First release

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for testing.rabbitmq, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size testing.rabbitmq-1.0.0-py2.py3-none-any.whl (9.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size testing.rabbitmq-1.0.0.tar.gz (4.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page