Exemplo n.º 1
0
    redis_conf = early_config.getvalue('redis_conf')
    if redis_conf and not path(redis_conf).isfile():
        raise ValueError(
            'argument passed to --redis-config is not a valid file path')
    rabbit_conf = early_config.getvalue('rabbit_conf')
    if rabbit_conf and not path(rabbit_conf).isfile():
        raise ValueError(
            'argument passed to --rabbit-config is not a valid file path')


redis_proc = factories.redis_proc()
redisdb = factories.redisdb('redis_proc')

mysql_proc = factories.mysql_proc()
mysql = factories.mysql('mysql_proc')


@pytest.fixture
def mysqldb(mysql):
    warnings.warn(
        '`mysqldb` fixture is deprecated. Please use `mysql` instead.',
        DeprecationWarning, 2)
    return mysql


rabbitmq_proc = factories.rabbitmq_proc()
rabbitmq = factories.rabbitmq('rabbitmq_proc')

dynamodb_proc = factories.dynamodb_proc()
dynamodb = factories.dynamodb('dynamodb_proc')
Exemplo n.º 2
0
        )


redis_proc = factories.redis_proc()
redisdb = factories.redisdb('redis_proc')

postgresql_proc = factories.postgresql_proc()
postgresql = factories.postgresql('postgresql_proc')

mysql_proc = factories.mysql_proc()
mysql = factories.mysql('mysql_proc')


@pytest.fixture
def mysqldb(mysql):
    warnings.warn(
        '`mysqldb` fixture is deprecated. Please use `mysql` instead.',
        DeprecationWarning,
        2
    )
    return mysql

elasticsearch_proc = factories.elasticsearch_proc()
elasticsearch = factories.elasticsearch('elasticsearch_proc')

rabbitmq_proc = factories.rabbitmq_proc()
rabbitmq = factories.rabbitmq('rabbitmq_proc')

mongo_proc = factories.mongo_proc()
mongodb = factories.mongodb('mongo_proc')
Exemplo n.º 3
0
from pytest_dbfixtures import factories
from pytest_dbfixtures.factories.rabbitmq_client import clear_rabbitmq


def test_rabbitmq(rabbitmq):
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN


rabbitmq_proc2 = factories.rabbitmq_proc(port=5674, node_name='test2')
rabbitmq2 = factories.rabbitmq('rabbitmq_proc2')


def test_second_rabbitmq(rabbitmq, rabbitmq2):

    print('checking first channel')
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN

    print('checking second channel')
    channel2 = rabbitmq2.channel()
    assert channel2.state == channel.OPEN


def test_rabbitmq_clear_exchanges(rabbitmq, rabbitmq_proc):
    """
    Declare exchange, and clear it by clear_rabbitmq.
    """
    from rabbitpy import Exchange
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN
Exemplo n.º 4
0
from pytest_dbfixtures import factories
from pytest_dbfixtures.factories.rabbitmq_client import clear_rabbitmq


def test_rabbitmq(rabbitmq):
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN


rabbitmq_proc2 = factories.rabbitmq_proc(port=5674, node_name='rabbitmqtest2')
rabbitmq2 = factories.rabbitmq('rabbitmq_proc2', port=5674)


def test_second_rabbitmq(rabbitmq, rabbitmq2):

    print('checking first channel')
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN

    print('checking second channel')
    channel2 = rabbitmq2.channel()
    assert channel2.state == channel.OPEN


def test_rabbitmq_clear_exchanges(rabbitmq, rabbitmq_proc):
    """
    Declare exchange, and clear it by clear_rabbitmq.
    """
    from rabbitpy import Exchange
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN
Exemplo n.º 5
0
from pytest_dbfixtures import factories
from pytest_dbfixtures.factories.rabbitmq_client import clear_rabbitmq


def test_rabbitmq(rabbitmq):
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN


rabbitmq_proc2 = factories.rabbitmq_proc(port=5674, node_name='test2')
rabbitmq2 = factories.rabbitmq('rabbitmq_proc2')


def test_second_rabbitmq(rabbitmq, rabbitmq2):

    print('checking first channel')
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN

    print('checking second channel')
    channel2 = rabbitmq2.channel()
    assert channel2.state == channel.OPEN


def test_rabbitmq_clear_exchanges(rabbitmq, rabbitmq_proc):
    """
    Declare exchange, and clear it by clear_rabbitmq.
    """
    from rabbitpy import Exchange
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN
Exemplo n.º 6
0
from pytest_dbfixtures import factories
from pytest_dbfixtures.factories.rabbitmq import clear_rabbitmq


def test_rabbitmq(rabbitmq):
    channel = rabbitmq.channel()
    assert channel.is_open


rabbitmq_proc2 = factories.rabbitmq_proc(port=5674, node_name='rabbitmqtest2')
rabbitmq2 = factories.rabbitmq('rabbitmq_proc2', port=5674)


def test_second_rabbitmq(rabbitmq, rabbitmq2):

    print 'checking first channel'
    channel = rabbitmq.channel()
    assert channel.is_open

    print 'checking second channel'
    channel2 = rabbitmq2.channel()
    assert channel2.is_open


def test_rabbitmq_clear_exchanges(rabbitmq, rabbitmq_proc):
    """
    Declare exchange, and clear it by clear_rabbitmq.
    """
    channel = rabbitmq.channel()
    assert channel.is_open