mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 05:29:38 -04:00
Sometimes test hang up and time out due to network errors (#2853)
* Fixed disable button, formated time to include time zone * Fixed bandit * Fix hanging test
This commit is contained in:
@@ -12,6 +12,7 @@ from bs4 import BeautifulSoup
|
||||
from dotenv import load_dotenv
|
||||
from flask import Flask, url_for
|
||||
|
||||
import app.utils.api_health
|
||||
from app import create_app
|
||||
from app.enums import AuthType, ServicePermission
|
||||
from notifications_python_client.errors import HTTPError
|
||||
@@ -35,6 +36,13 @@ from . import (
|
||||
user_json,
|
||||
)
|
||||
|
||||
# Mock is_api_down to prevent network calls during unit tests
|
||||
# Set API_HOST_NAME to localhost to avoid network timeouts (sometimes they slow down in cicd)
|
||||
os.environ["API_HOST_NAME"] = "http://localhost:6011"
|
||||
|
||||
# Also mock the function itself as a backup
|
||||
app.utils.api_health.is_api_down = lambda: False
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user