예제 #1
0
 def testFromMapLowercase(self):
     conf = Config()
     env = {'prefix_hElLo':'world'}
     conf.fromMap(env, 'prefix_')
     self.assertFalse(conf.has('hElLo'))
     self.assertTrue(conf.has('hello'))
     self.assertEqual('world', conf.get('hello'))
예제 #2
0
 def testFromMapWithPrefix(self):
     conf = Config()
     env = {'prefix_hello':'world', 'nonprefix_foo':'bar'}
     conf.fromMap(env, 'prefix_')
     self.assertFalse(conf.has('prefix_hello'))
     self.assertFalse(conf.has('nonprefix_foo'))
     self.assertTrue(conf.has('hello'))
     self.assertFalse(conf.has('foo'))
     self.assertEqual('world', conf.get('hello'))
예제 #3
0
 def testPutAndGet(self):
     conf = Config()
     conf.put('hello', 'world')
     self.assertTrue(conf.has('hello'))
     self.assertEqual('world', conf.get('hello'))