예제 #1
0
 def test_set_secret_on_env(self):
     from analyticsconfig import ConfigFacade
     c = ConfigFacade()
     self.assertIsNone(c.get_secret('sec', environment='temp'))
     c.set_secret(key='sec', value='hpoi', environment='temp')
     self.assertEqual(c.get_secret('sec', environment='temp'), 'hpoi')
     self.assertIsNone(c.get_secret('sec'))
예제 #2
0
from analyticsconfig import ConfigFacade

c = ConfigFacade()
print(c.get_secret('asd', default='123'))
예제 #3
0
 def test_get_default_secret_from_default(self):
     from analyticsconfig import ConfigFacade
     c = ConfigFacade()
     self.assertIsNone(c.get_secret('asdasd'))
예제 #4
0
 def test_get_secret_from_default(self):
     from analyticsconfig import ConfigFacade
     c = ConfigFacade()
     self.assertEqual(c.get_secret('asd'), 'blabla')
예제 #5
0
 def test_set_secret_on_default(self):
     from analyticsconfig import ConfigFacade
     c = ConfigFacade()
     self.assertIsNone(c.get_setting('sec'))
     c.set_secret(key='sec', value='hpoi')
     self.assertEqual(c.get_secret('sec'), 'hpoi')
예제 #6
0
 def test_get_setting_from_env(self):
     from analyticsconfig import ConfigFacade
     c = ConfigFacade()
     self.assertEqual(c.get_setting('qwe'), 241)
     self.assertEqual(c.get_setting('qwe', environment='production'), 395)