# Path: collectors/base/config.py
# ENV = os.environ.get('PYTHON_ENV', 'development')
#     ENV = 'testing'
#     WAREHOUSE_URL = os.environ['TEST_WAREHOUSE_URL']
#     WAREHOUSE_URL = os.environ['WAREHOUSE_URL']
# SCRAPY_SETTINGS = {
#     'SPIDER_MODULES': [
#         'collectors.actrn.spider',
#         'collectors.euctr.spider',
#         'collectors.gsk.spider',
#         'collectors.ictrp.spider',
#         'collectors.isrctn.spider',
#         'collectors.jprn.spider',
#         'collectors.pfizer.spider',
#         'collectors.pubmed.spider',
#         'collectors.takeda.spider',
#     ],
#     'DOWNLOAD_DELAY': float(os.getenv('DOWNLOAD_DELAY', 1)),
#     'AUTOTHROTTLE_ENABLED': True,
#     'ITEM_PIPELINES': {
#         'collectors.base.pipelines.Warehouse': 100,
#     },
# }
# SENTRY_DSN = os.environ.get('SENTRY_DSN')
# SENTRY = raven.Client(SENTRY_DSN)
# LOGGING_CONFIG = {
#     'version': 1,
#     'disable_existing_loggers': False,
#     'formatters': {
#         'default': {
#             'format': '%(levelname)s %(name)s: %(message)s',
#         },
#     },
#     'handlers': {
#         'default_handler': {
#             'class': 'logging.StreamHandler',
#             'stream': 'ext://sys.stdout',
#             'level': 'DEBUG',
#             'formatter': 'default'
#         },
#         'syslog_handler': {
#             '()': setup_syslog_handler,
#             'level': 'INFO',
#             'formatter': 'default',
#         },
#         'sentry': {
#             'level': 'ERROR',
#             'class': 'raven.handlers.logging.SentryHandler',
#             'dsn': SENTRY_DSN,
#         },
#     },
#     'root': {
#         'handlers': ['default_handler', 'syslog_handler'],
#         'level': os.environ.get('LOGGING_LEVEL', 'DEBUG').upper(),
#     },
# }
# ICTRP_USER = os.environ.get('ICTRP_USER', None)
# ICTRP_PASS = os.environ.get('ICTRP_PASS', None)
# HRA_ENV = os.environ.get('HRA_ENV', None)
# HRA_URL = os.environ.get('HRA_URL', None)
# HRA_USER = os.environ.get('HRA_USER', None)
# HRA_PASS = os.environ.get('HRA_PASS', None)
# COCHRANE_ARCHIVE_URL = os.environ.get('COCHRANE_ARCHIVE_URL')
# def setup_syslog_handler():
# 
# Path: collectors/base/helpers.py
# def slugify(value):
# def parse_date(value, format):
# def parse_datetime(value, format):
# def get_variables(object, filter=None):
# def start(conf, name, message):
# def stop(conf, name, message):


import os
import pytest
import betamax
import dataset
from scrapy.http import Request, HtmlResponse
from collectors.base import config, helpers
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals



with betamax.Betamax.configure() as cfg:
    cfg.cassette_library_dir = 'tests/cassettes/'

    record_mode = 'none' if os.environ.get('CI') else 'once'
    cfg.default_cassette_options['record_mode'] = record_mode
    cfg.default_cassette_options['match_requests_on'] = [
        'uri',
        'method',
        'headers',
        'body',
    ]


# Fixtures

@pytest.fixture
def conf():

# Path: collectors/base/config.py
# ENV = os.environ.get('PYTHON_ENV', 'development')
#     ENV = 'testing'
#     WAREHOUSE_URL = os.environ['TEST_WAREHOUSE_URL']
#     WAREHOUSE_URL = os.environ['WAREHOUSE_URL']
# SCRAPY_SETTINGS = {
#     'SPIDER_MODULES': [
#         'collectors.actrn.spider',
#         'collectors.euctr.spider',
#         'collectors.gsk.spider',
#         'collectors.ictrp.spider',
#         'collectors.isrctn.spider',
#         'collectors.jprn.spider',
#         'collectors.pfizer.spider',
#         'collectors.pubmed.spider',
#         'collectors.takeda.spider',
#     ],
#     'DOWNLOAD_DELAY': float(os.getenv('DOWNLOAD_DELAY', 1)),
#     'AUTOTHROTTLE_ENABLED': True,
#     'ITEM_PIPELINES': {
#         'collectors.base.pipelines.Warehouse': 100,
#     },
# }
# SENTRY_DSN = os.environ.get('SENTRY_DSN')
# SENTRY = raven.Client(SENTRY_DSN)
# LOGGING_CONFIG = {
#     'version': 1,
#     'disable_existing_loggers': False,
#     'formatters': {
#         'default': {
#             'format': '%(levelname)s %(name)s: %(message)s',
#         },
#     },
#     'handlers': {
#         'default_handler': {
#             'class': 'logging.StreamHandler',
#             'stream': 'ext://sys.stdout',
#             'level': 'DEBUG',
#             'formatter': 'default'
#         },
#         'syslog_handler': {
#             '()': setup_syslog_handler,
#             'level': 'INFO',
#             'formatter': 'default',
#         },
#         'sentry': {
#             'level': 'ERROR',
#             'class': 'raven.handlers.logging.SentryHandler',
#             'dsn': SENTRY_DSN,
#         },
#     },
#     'root': {
#         'handlers': ['default_handler', 'syslog_handler'],
#         'level': os.environ.get('LOGGING_LEVEL', 'DEBUG').upper(),
#     },
# }
# ICTRP_USER = os.environ.get('ICTRP_USER', None)
# ICTRP_PASS = os.environ.get('ICTRP_PASS', None)
# HRA_ENV = os.environ.get('HRA_ENV', None)
# HRA_URL = os.environ.get('HRA_URL', None)
# HRA_USER = os.environ.get('HRA_USER', None)
# HRA_PASS = os.environ.get('HRA_PASS', None)
# COCHRANE_ARCHIVE_URL = os.environ.get('COCHRANE_ARCHIVE_URL')
# def setup_syslog_handler():
# 
# Path: collectors/base/helpers.py
# def slugify(value):
# def parse_date(value, format):
# def parse_datetime(value, format):
# def get_variables(object, filter=None):
# def start(conf, name, message):
# def stop(conf, name, message):


# Path: tests/conftest.py
import os
import pytest
import betamax
import dataset
from scrapy.http import Request, HtmlResponse
from collectors.base import config, helpers

# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals



with betamax.Betamax.configure() as cfg:
    cfg.cassette_library_dir = 'tests/cassettes/'

    record_mode = 'none' if os.environ.get('CI') else 'once'
    cfg.default_cassette_options['record_mode'] = record_mode
    cfg.default_cassette_options['match_requests_on'] = [
        'uri',
        'method',
        'headers',
        'body',
    ]


# Fixtures

@pytest.fixture
def conf():

    return helpers.get_variables(config, str.isupper)