def test_getstr_strip_whitespace(self): os.environ['TEST_VALUE_STR'] = ' hello ' self.assertEquals(envconfig.str('TEST_VALUE_STR'), 'hello')
def test_getinvalid(self): if 'DOES_NOT_EXIST' in os.environ: del os.environ['DOES_NOT_EXIST'] self.assertRaises(KeyError, lambda: envconfig.str('DOES_NOT_EXIST'))
def test_getstr(self): os.environ['TEST_VALUE_STR'] = 'Hello, World' self.assertEquals(envconfig.str('TEST_VALUE_STR'), 'Hello, World')
def test_getstr_strip_whitespace(self): os.environ['TEST_VALUE_STR'] = ' hello ' self.assertEqual(envconfig.str('TEST_VALUE_STR'), 'hello')
def test_getstr(self): os.environ['TEST_VALUE_STR'] = 'Hello, World' self.assertEqual(envconfig.str('TEST_VALUE_STR'), 'Hello, World')
import envconfig # Deployment specific settings port = envconfig.int('PORT') debug = envconfig.bool('DEBUG') client_key = envconfig.str('CLIENT_KEY') workers = envconfig.int('WEB_CONCURRENCY') # Resizer behavior mode = 'clip' # Quality filter = 'antialias' progressive = True quality = 'keep'