mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 20:03:12 -04:00
Updated unit test
This commit is contained in:
@@ -9,14 +9,18 @@ class FakeService:
|
|||||||
id = "1234"
|
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
|
@pytest.fixture
|
||||||
def app():
|
def app():
|
||||||
flask_app = Flask(__name__)
|
flask_app = Flask(__name__)
|
||||||
ctx = flask_app.app_context()
|
ctx = flask_app.app_context()
|
||||||
ctx.push()
|
ctx.push()
|
||||||
|
|
||||||
yield flask_app
|
yield flask_app
|
||||||
|
|
||||||
ctx.pop()
|
ctx.pop()
|
||||||
|
|
||||||
|
|
||||||
@@ -26,10 +30,8 @@ def celery_app(mocker):
|
|||||||
app.config["CELERY"] = {"broker_url": "foo"}
|
app.config["CELERY"] = {"broker_url": "foo"}
|
||||||
app.config["NOTIFY_TRACE_ID_HEADER"] = "Ex-Notify-Request-Id"
|
app.config["NOTIFY_TRACE_ID_HEADER"] = "Ex-Notify-Request-Id"
|
||||||
request_helper.init_app(app)
|
request_helper.init_app(app)
|
||||||
|
|
||||||
ctx = app.app_context()
|
ctx = app.app_context()
|
||||||
ctx.push()
|
ctx.push()
|
||||||
|
|
||||||
yield app
|
yield app
|
||||||
ctx.pop()
|
ctx.pop()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user