Skip to content
Snippets Groups Projects
Commit 3cbd16fb authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

PEP8

parent 916b4a13
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -3,4 +3,3 @@ from fractalis.config import configure_app
app = Flask(__name__)
configure_app(app)
import os
class BaseConfig():
DEBUG = False
TESTING = False
class DevelopmentConfig(BaseConfig):
DEBUG = True
TESTING = False
class TestingConfig(BaseConfig):
DEBUG = False
TESTING = True
......@@ -18,10 +21,11 @@ config = {
'production': 'fractalis.config.BaseConfig'
}
def configure_app(app):
mode = os.getenv('FRACTALIS_MODE', default='production')
try:
app.config.from_object(config[mode])
except KeyError as e:
raise KeyError("'{}' is no valid value for the FRACTALIS_MODE "
"environment variable.".format(mode)) from e
"environment variable.".format(mode)) from e
......@@ -4,16 +4,16 @@ from distutils.core import setup
from setuptools import find_packages
setup(
name = 'fractalis',
packages = find_packages(),
install_requires = [
name='fractalis',
packages=find_packages(),
install_requires=[
'Flask',
'celery'
],
setup_requires = [
setup_requires=[
'pytest-runner',
],
tests_require = [
tests_require=[
'pytest==3.0.3',
'pytest-cov'
]
......
import os
import fractalis
import pytest
from importlib import reload
import pytest
import fractalis
class TestConfig:
def test_config_when_test_mode(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment