Beispiel #1
0
"""Tests main conftest file."""
import warnings

from pytest_redis import factories

warnings.filterwarnings("error",
                        category=DeprecationWarning,
                        module="(_pytest|pytest|redis|path|mirakuru).*")

# pylint:disable=invalid-name
redis_proc2 = factories.redis_proc(port=6381)
redis_nooproc2 = factories.redis_noproc(port=6381)
redisdb2 = factories.redisdb("redis_proc2")
redisdb2_noop = factories.redisdb("redis_nooproc2")
# pylint:enable=invalid-name
Beispiel #2
0
    parser.addoption("--redis-save",
                     action="store",
                     dest="redis_save",
                     help=_help_save)
    parser.addoption("--redis-compression",
                     action="store_true",
                     dest="redis_compression",
                     help=_help_compress)
    parser.addoption("--redis-rdbchecksum",
                     action="store_true",
                     dest="redis_rdbchecksum",
                     help=_help_rdbchecksum)
    parser.addoption("--redis-syslog",
                     action="store_true",
                     dest="redis_syslog",
                     help=_help_syslog)
    parser.addoption("--redis-client-decode",
                     action="store_true",
                     dest="redis_decode",
                     help=_help_decode)
    parser.addoption("--redis-datadir",
                     action="store",
                     dest="redis_datadir",
                     help=_help_datadir)


redis_proc = factories.redis_proc()
redis_nooproc = factories.redis_noproc()
redisdb = factories.redisdb("redis_proc")
# pylint:enable=invalid-name
Beispiel #3
0
    return json_from_file(request, "MedicationRequestBundleR4.json")


@fixture
def patient_b_jackson(request):
    return json_from_file(request, "PatientBJackson.json")


@fixture
def pdmp_med_request_bundle(request):
    return json_from_file(request, "PDMP-MedicationRequestBundleR4.json")


real_redis_connection = SESSION_REDIS.connection_pool.get_connection(
    'testing-connection')
redis_factory = factories.redis_noproc(host=real_redis_connection.host)
redis_handle = factories.redisdb('redis_factory')


@fixture
def redis_session(client, redis_handle):
    """Loads a redis-session with a mock patient id and iss"""
    session_prefix = client.application.config.get('SESSION_KEY_PREFIX',
                                                   'session:')
    session_key = f'{session_prefix}{session_id}'
    session_data = {
        'iss': emr_endpoint,
        'token_response': {
            'patient': patient_id
        }
    }