Browse Source

Add test asserting default behavior of ENV_LOAD_ALL

dev/env.load.all
Brett Langdon 8 years ago
parent
commit
77e8487b73
No known key found for this signature in database GPG Key ID: B664881177781B04
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      test_flask_env.py

+ 12
- 0
test_flask_env.py View File

@ -13,6 +13,18 @@ class TestFlaskEnv(unittest.TestCase):
**kwargs
))
def test_default_env_load_all(self):
"""A test to ensure that we load all environment variables by default"""
# Configure an environment variable not defined on the configuration class
os.environ['TEST_SETTING'] = 'true'
# Create our configuration object
TestConfiguration = MetaFlaskEnv('TestConfiguration', (object, ), dict())
# Assert that we loaded all environment variables
self.assertTrue(TestConfiguration.TEST_SETTING)
def test_default_settings(self):
"""A test to ensure that if no environment variable is set, we get the default value that is set"""
TestConfiguration = self._get_test_configuration(DEFAULT_SETTING='default_value')


Loading…
Cancel
Save