示例#1
0
def app():
    """Application for the tests."""
    _app = create_app(TestingConfig)
    ctx = _app.test_request_context()
    ctx.push()

    yield _app

    ctx.pop()
示例#2
0
def test_production_config():
    """Production config."""
    app = create_app(ProductionConfig)
    assert app.config['ENV'] == 'production'
    assert app.config['DEBUG'] is False
    assert app.config['TESTING'] is False
    assert app.config['LOG_LEVEL'] in [
        logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG
    ]
    assert app.config.get('URL_PREFIX', None)
示例#3
0
def test_dev_config():
    """Development config."""
    app = create_app(DevelopmentConfig)
    assert app.config['ENV'] == 'development'
    assert app.config['DEBUG'] is True
    assert app.config['TESTING'] is False
    assert app.config['LOG_LEVEL'] in [
        logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG
    ]
    assert app.config.get('URL_PREFIX', None) is None
示例#4
0
def test_test_config():
    """Testing configuration."""
    app = create_app(TestingConfig)
    assert app.config['ENV'] == 'testing'
    assert app.config['DEBUG'] is True
    assert app.config['TESTING'] is True
    assert app.config['LOG_LEVEL'] in [
        logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG
    ]
    assert app.config.get('URL_PREFIX', None) is None
示例#5
0
"""Create an application instance."""
import os

from notifyme.app import create_app
from notifyme.config import DevelopmentConfig

app_config = os.getenv('APP_CONFIG', DevelopmentConfig)
app = create_app(config_object=app_config)