# Path: matl_online/app.py
# def create_app(config_object=ProdConfig):
#     """Application factory for creating flask apps."""
#     app = Flask(__name__)
#     app.config.from_object(config_object)
#     register_extensions(app)
#     register_blueprints(app)
#     return app
# 
# Path: matl_online/settings.py
# class DevConfig(Config):
#     """Development configuration."""
# 
#     ENV = 'dev'
#     DEBUG = True
#     ASSETS_DEBUG = True
# 
#     ROLLBAR_ENV = 'development'
# 
# class ProdConfig(Config):
#     """Production configuration."""
# 
#     ENV = 'prod'
#     DEBUG = False
#     ASSETS_DEBUG = False
# 
#     GOOGLE_ANALYTICS_UNIVERSAL_ID = os.environ.get('GOOGLE_ANALYTICS_UNIVERSAL_ID')
# 
#     ROLLBAR_ENV = 'production'
# 
# def get_config():
#     """Retrieve the current active configuration based on env variables."""
#     env = os.environ.get('MATL_ONLINE_ENV', 'dev')
# 
#     return {
#         'prod': ProdConfig,
#         'dev': DevConfig,
#         'test': TestConfig
#     }[env.lower()]


import os
from matl_online.app import create_app
from matl_online.settings import DevConfig, ProdConfig, get_config
"""Unit tests for testing the development and production configurations."""




def test_production_config():
    """Production config."""
    app = create_app(ProdConfig)
    assert app.config['ENV'] == 'prod'
    assert app.config['DEBUG'] is False
    assert app.config['ASSETS_DEBUG'] is False


def test_dev_config():
    """Development config."""
    app = create_app(DevConfig)
    assert app.config['ENV'] == 'dev'
    assert app.config['DEBUG'] is True
    assert app.config['ASSETS_DEBUG'] is True


def test_prod_config_lookup():
    """Ensure that we load the proper config."""
    os.environ['MATL_ONLINE_ENV'] = 'prod'


# Path: matl_online/app.py
# def create_app(config_object=ProdConfig):
#     """Application factory for creating flask apps."""
#     app = Flask(__name__)
#     app.config.from_object(config_object)
#     register_extensions(app)
#     register_blueprints(app)
#     return app
# 
# Path: matl_online/settings.py
# class DevConfig(Config):
#     """Development configuration."""
# 
#     ENV = 'dev'
#     DEBUG = True
#     ASSETS_DEBUG = True
# 
#     ROLLBAR_ENV = 'development'
# 
# class ProdConfig(Config):
#     """Production configuration."""
# 
#     ENV = 'prod'
#     DEBUG = False
#     ASSETS_DEBUG = False
# 
#     GOOGLE_ANALYTICS_UNIVERSAL_ID = os.environ.get('GOOGLE_ANALYTICS_UNIVERSAL_ID')
# 
#     ROLLBAR_ENV = 'production'
# 
# def get_config():
#     """Retrieve the current active configuration based on env variables."""
#     env = os.environ.get('MATL_ONLINE_ENV', 'dev')
# 
#     return {
#         'prod': ProdConfig,
#         'dev': DevConfig,
#         'test': TestConfig
#     }[env.lower()]


# Path: tests/test_config.py
import os
from matl_online.app import create_app
from matl_online.settings import DevConfig, ProdConfig, get_config

"""Unit tests for testing the development and production configurations."""




def test_production_config():
    """Production config."""
    app = create_app(ProdConfig)
    assert app.config['ENV'] == 'prod'
    assert app.config['DEBUG'] is False
    assert app.config['ASSETS_DEBUG'] is False


def test_dev_config():
    """Development config."""
    app = create_app(DevConfig)
    assert app.config['ENV'] == 'dev'
    assert app.config['DEBUG'] is True
    assert app.config['ASSETS_DEBUG'] is True


def test_prod_config_lookup():
    """Ensure that we load the proper config."""
    os.environ['MATL_ONLINE_ENV'] = 'prod'


    assert get_config() == ProdConfig