mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-18 05:31:48 -05:00
- adds a base client - adds a notifications client These do not proxy onto genuine methods. This pull request is the basic implication of the API Client. Still needs a few things before is ready, notably proper logging and actual API endpoints to hook into. Basic premise is to deliver the JWT tokens required for Notify API authentication so we can discuss the implementation/premise.
32 lines
654 B
Python
32 lines
654 B
Python
import pytest
|
|
import mock
|
|
from app import create_app
|
|
from config import configs
|
|
|
|
|
|
@pytest.fixture(scope='session')
|
|
def notify_api(request):
|
|
app = create_app('test')
|
|
ctx = app.app_context()
|
|
ctx.push()
|
|
|
|
def teardown():
|
|
ctx.pop()
|
|
|
|
request.addfinalizer(teardown)
|
|
return app
|
|
|
|
|
|
@pytest.fixture(scope='function')
|
|
def notify_config(notify_api):
|
|
notify_api.config['NOTIFY_API_ENVIRONMENT'] = 'test'
|
|
notify_api.config.from_object(configs['test'])
|
|
|
|
|
|
@pytest.fixture(scope='function')
|
|
def os_environ(request):
|
|
env_patch = mock.patch('os.environ', {})
|
|
request.addfinalizer(env_patch.stop)
|
|
|
|
return env_patch.start()
|