Exemplo n.º 1
0
def client():
    app.config['TESTING'] = True
    rabbitmq_my_proc = factories.rabbitmq_proc(port=8888)
    rabbitmq = factories.rabbitmq('rabbitmq_my_proc')

    with app.test_client() as client:
        yield client
Exemplo n.º 2
0
import pytest
from flask import Flask
from pytest_rabbitmq import factories

from flask_coney import Coney
from flask_coney import get_state

rabbitmq_proc = factories.rabbitmq_proc()
rabbitmq = factories.rabbitmq("rabbitmq_proc")


@pytest.fixture
def app():
    app = Flask(__name__)
    app.testing = True
    app.config["CONEY_BROKER_URI"] = "amqp://*****:*****@localhost:6789"
    return app


@pytest.fixture
def coney(app):
    with app.app_context():
        coney = Coney(app)
        yield coney

        for consumer, thread in get_state(app).consumer_threads:
            consumer.stop()
            thread.join()


@pytest.fixture
Exemplo n.º 3
0
import pika
import os
import pytest
import shutil
import mirakuru
from elasticsearch import Elasticsearch
from pytest_postgresql import factories
import time

pgsql_proc = factories.postgresql_proc(executable='/usr/bin/pg_ctl',
                                       host='localhost',
                                       port=45678,
                                       user='******')
pgsql_db = factories.postgresql('pgsql_proc', db='morp_tests')

rabbitmq_pika_proc = rabbitmq_proc(
    server='/usr/lib/rabbitmq/bin/rabbitmq-server', port=34567)


@pytest.fixture
def pika_connection_channel(rabbitmq_pika_proc):
    connection = pika.BlockingConnection(
        pika.ConnectionParameters(host='localhost',
                                  port=34567,
                                  credentials=pika.PlainCredentials(
                                      'guest', 'guest')))
    channel = connection.channel()
    return [connection, channel]


@pytest.fixture(scope='session')
def es_proc(request):
Exemplo n.º 4
0
"""Tests main conftest file."""
from pytest_rabbitmq import factories

# pylint:disable=invalid-name
rabbitmq_proc2 = factories.rabbitmq_proc(port=5674, node='test2')
rabbitmq2 = factories.rabbitmq('rabbitmq_proc2')
rabbitmq_rand_proc = factories.rabbitmq_proc(port=None, node='test3')
rabbitmq_rand = factories.rabbitmq('rabbitmq_rand_proc')
rabbitmq_rand_proc2 = factories.rabbitmq_proc(port=None)
rabbitmq_rand_proc3 = factories.rabbitmq_proc(port=None)
# pylint:enable=invalid-name
Exemplo n.º 5
0
from pytest_rabbitmq import factories

rabbitmq_proc = factories.rabbitmq_proc(port=5440)