Files
notifications-admin/tests/notifications_utils/conftest.py
Carlo Costino 57e9fc9ba1 Localize notification_utils to the Admin!
This changeset copies everything in notifications_utils to turn into a local project module.  It includes dependency changes to account for this adjustment and the notifications_utils tests.  It also fixes all of the import statements.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2024-04-05 12:51:31 -04:00

46 lines
752 B
Python

import pytest
import requests_mock
from flask import Flask
from notifications_utils import request_helper
class FakeService:
id = "1234"
@pytest.fixture
def app():
flask_app = Flask(__name__)
ctx = flask_app.app_context()
ctx.push()
yield flask_app
ctx.pop()
@pytest.fixture
def celery_app(mocker):
app = Flask(__name__)
app.config["CELERY"] = {"broker_url": "foo"}
app.config["NOTIFY_TRACE_ID_HEADER"] = "Ex-Notify-Request-Id"
request_helper.init_app(app)
ctx = app.app_context()
ctx.push()
yield app
ctx.pop()
@pytest.fixture(scope="session")
def sample_service():
return FakeService()
@pytest.fixture
def rmock():
with requests_mock.mock() as rmock:
yield rmock