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'))
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'))
def testPutAndGet(self): conf = Config() conf.put('hello', 'world') self.assertTrue(conf.has('hello')) self.assertEqual('world', conf.get('hello'))