# Path: mass_flask_config/app.py
# BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# SECRET_FILE = os.path.join(BASE_DIR, 'secret.txt')
# def setup_session_auth(user_loader):
# def setup_key_based_auth(key_loader):
# def unauthorized_callback():
# 
# Path: mass_flask_config/bootstrap.py
# def bootstrap_mass_flask():
#     connect_signals()
#     app.register_blueprint(api_blueprint, url_prefix='/api')
#     app.register_blueprint(webui_blueprint, url_prefix='/webui')
#     app.register_blueprint(scheduling_blueprint, url_prefix='/scheduling')


from unittest import TestCase
from mongoengine import connection
from mass_flask_config.app import app
from mass_flask_config.bootstrap import bootstrap_mass_flask


class FlaskTestCase(TestCase):
    @staticmethod
    def _clean_test_database():
        conn = connection.get_connection()
        db = connection.get_db()
        conn.drop_database(db)

    def __call__(self, result=None):
        self._pre_setup()
        super(FlaskTestCase, self).__call__(result)
        self._post_tearDown()

    def _pre_setup(self):
        bootstrap_mass_flask()

# Path: mass_flask_config/app.py
# BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# SECRET_FILE = os.path.join(BASE_DIR, 'secret.txt')
# def setup_session_auth(user_loader):
# def setup_key_based_auth(key_loader):
# def unauthorized_callback():
# 
# Path: mass_flask_config/bootstrap.py
# def bootstrap_mass_flask():
#     connect_signals()
#     app.register_blueprint(api_blueprint, url_prefix='/api')
#     app.register_blueprint(webui_blueprint, url_prefix='/webui')
#     app.register_blueprint(scheduling_blueprint, url_prefix='/scheduling')


# Path: mass_flask_core/tests/flask_test_case.py
from unittest import TestCase
from mongoengine import connection
from mass_flask_config.app import app
from mass_flask_config.bootstrap import bootstrap_mass_flask



class FlaskTestCase(TestCase):
    @staticmethod
    def _clean_test_database():
        conn = connection.get_connection()
        db = connection.get_db()
        conn.drop_database(db)

    def __call__(self, result=None):
        self._pre_setup()
        super(FlaskTestCase, self).__call__(result)
        self._post_tearDown()

    def _pre_setup(self):
        bootstrap_mass_flask()

        if not 'MASS_TESTING' in app.config or app.config['MASS_TESTING'] is False: