[conf] production now defaults to true
This commit is contained in:
parent
0173eb6d72
commit
1f20a336e2
|
@ -48,7 +48,7 @@ from .logging import logger
|
|||
PROJECT_NAME = environ.get('HALFAPI_PROJECT_NAME') or os.path.basename(os.getcwd())
|
||||
DOMAINSDICT = lambda: {}
|
||||
DOMAINS = {}
|
||||
PRODUCTION = False
|
||||
PRODUCTION = True
|
||||
LOGLEVEL = 'info'
|
||||
HOST = '127.0.0.1'
|
||||
PORT = '3000'
|
||||
|
@ -133,7 +133,7 @@ except FileNotFoundError as exc:
|
|||
logger.error('Missing secret file: %s', exc)
|
||||
|
||||
PRODUCTION = config.getboolean('project', 'production',
|
||||
fallback=environ.get('HALFAPI_PROD', False))
|
||||
fallback=environ.get('HALFAPI_PROD', True))
|
||||
|
||||
LOGLEVEL = config.get('project', 'loglevel',
|
||||
fallback=environ.get('HALFAPI_LOGLEVEL', 'info')).lower()
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
from halfapi.halfapi import HalfAPI
|
||||
|
||||
def test_conf_production_default():
|
||||
halfapi = HalfAPI({
|
||||
'DOMAINS': {'test': True}
|
||||
})
|
||||
assert halfapi.PRODUCTION is True
|
||||
|
||||
def test_conf_production_true():
|
||||
halfapi = HalfAPI({
|
||||
'PRODUCTION': True,
|
||||
'DOMAINS': {'test': True}
|
||||
})
|
||||
assert halfapi.PRODUCTION is True
|
||||
|
||||
def test_conf_production_false():
|
||||
halfapi = HalfAPI({
|
||||
'PRODUCTION': False,
|
||||
'DOMAINS': {'test': True}
|
||||
})
|
||||
assert halfapi.PRODUCTION is False
|
||||
|
Loading…
Reference in New Issue