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

fixing tests

parent 9e30085b
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -2,7 +2,6 @@ image: python:3
before_script:
- pip install -e .
- pip install unittest
test:
script:
......
import os
import fractalis
from importlib import reload
from test.support import EnvironmentVarGuard
class TestConfig:
env_var_guard = EnvironmentVarGuard()
def test_config_when_test_mode(self):
self.env_var_guard.set('FRACTALIS_MODE', 'testing')
os.environ['FRACTALIS_MODE'] = 'testing'
reload(fractalis)
assert not fractalis.app.config['DEBUG']
assert fractalis.app.config['TESTING']
def test_config_when_development_mode(self):
self.env_var_guard.set('FRACTALIS_MODE', 'development')
os.environ['FRACTALIS_MODE'] = 'development'
reload(fractalis)
assert fractalis.app.config['DEBUG']
assert not fractalis.app.config['TESTING']
def test_config_when_production_mode(self):
self.env_var_guard.set('FRACTALIS_MODE', 'production')
os.environ['FRACTALIS_MODE'] = 'production'
reload(fractalis)
assert not fractalis.app.config['DEBUG']
assert not fractalis.app.config['TESTING']
def test_config_when_default(self):
self.env_var_guard.unset('FRACTALIS_MODE')
del os.environ['FRACTALIS_MODE']
reload(fractalis)
assert not fractalis.app.config['DEBUG']
assert not fractalis.app.config['TESTING']
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