mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-04 16:11:11 -04:00
Updated unit test
This commit is contained in:
@@ -9,14 +9,18 @@ class FakeService:
|
||||
id = "1234"
|
||||
|
||||
|
||||
# Automatically mock API health check to prevent real HTTP calls during tests
|
||||
@pytest.fixture(autouse=True)
|
||||
def _mock_api_health(mocker):
|
||||
mocker.patch("app.utils.api_health.is_api_down", return_value=False)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def app():
|
||||
flask_app = Flask(__name__)
|
||||
ctx = flask_app.app_context()
|
||||
ctx.push()
|
||||
|
||||
yield flask_app
|
||||
|
||||
ctx.pop()
|
||||
|
||||
|
||||
@@ -26,10 +30,8 @@ def celery_app(mocker):
|
||||
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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user