def test_create_app_missing_requirement(mock_app): """Tests the function that creates the app when phenotype_annotation.tab.txt and hp.obo.txt resources are missing""" # GIVEN one of the required files missing / it's been renamed temp_file = ".".join([path_to_hpo_terms, "temp"]) os.rename(path_to_hpo_terms, temp_file) # THEN the app should not be created app = create_app() assert app is None # Revert original resource name os.rename(temp_file, path_to_hpo_terms)
def test_create_app(): """Tests the function that creates the app""" assert create_app()
from werkzeug.contrib.fixers import ProxyFix from patientMatcher.server import create_app app = create_app() app.wsgi_app = ProxyFix(app.wsgi_app)
def mock_app(database, pymongo_client): app = create_app() app.db = database app.client = pymongo_client return app