from flask import Flask from flask_cors import CORS from flask_migrate import Migrate from application_roles.model_utils import get_db from .pipelines import models as pipeline_models from .workflows import models as workflow_models from . import constants from .pipelines.routes import organization_pipeline_bp from .workflows.routes import organization_workflow_bp db = get_db() # Allow a specific set of environmental variables to be configurable: CONFIG_VARS = ( constants.FLASK_ENV, constants.SECRET_KEY, constants.SQLALCHEMY_DATABASE_URI, constants.S3_ACCESS_KEY_ID, constants.S3_SECRET_ACCESS_KEY, constants.S3_ENDPOINT_URL, constants.S3_REGION_NAME, constants.S3_BUCKET, constants.S3_PRESIGNED_TIMEOUT, constants.AUTH_HOSTNAME, constants.WORKFLOW_HOSTNAME, constants.WORKFLOW_API_TOKEN,
def test_get_db_default_name(): """Tests db default name. """ assert get_db("tests.sample_db") == "sample"
def test_get_db_default(): """Tests db default. """ assert get_db() is not None
def test_get_db_bad_module(): """ Tests bad module. """ with pytest.raises(ModuleNotFoundError): get_db("should_error")