Ejemplo n.º 1
0
def perf_client(client, mocker):
    perf_client = PerformancePlatformClient()
    current_app = mocker.Mock(
        config={
            "PERFORMANCE_PLATFORM_ENABLED": True,
            "PERFORMANCE_PLATFORM_ENDPOINTS": {"foo": "my_token", "bar": "other_token"},
            "PERFORMANCE_PLATFORM_URL": "https://performance-platform-url/",
        }
    )
    perf_client.init_app(current_app)
    return perf_client
Ejemplo n.º 2
0
def perf_client(client, mocker):
    perf_client = PerformancePlatformClient()
    current_app = mocker.Mock(
        config={
            'PERFORMANCE_PLATFORM_ENABLED': True,
            'PERFORMANCE_PLATFORM_ENDPOINTS': {
                'foo': 'my_token',
                'bar': 'other_token'
            },
            'PERFORMANCE_PLATFORM_URL': 'https://performance-platform-url/'
        })
    perf_client.init_app(current_app)
    return perf_client
Ejemplo n.º 3
0
twilio_sms_client = TwilioSMSClient(
    account_sid=os.getenv('TWILIO_ACCOUNT_SID'),
    auth_token=os.getenv('TWILIO_AUTH_TOKEN'),
    from_number=os.getenv('TWILIO_FROM_NUMBER'),
)
smtp_client = SMTPClient(
    addr=os.getenv('SMTP_ADDR'),
    user=os.getenv('SMTP_USER'),
    password=os.getenv('SMTP_PASSWORD'),
)
aws_ses_client = AwsSesClient()
encryption = Encryption()
deskpro_client = DeskproClient()
statsd_client = StatsdClient()
redis_store = RedisClient()
performance_platform_client = PerformancePlatformClient()

clients = Clients()

api_user = LocalProxy(lambda: _request_ctx_stack.top.api_user)
authenticated_service = LocalProxy(
    lambda: _request_ctx_stack.top.authenticated_service)


def create_app(application):
    from app.config import configs

    notify_environment = os.environ['NOTIFY_ENVIRONMENT']

    application.config.from_object(configs[notify_environment])