コード例 #1
0
ファイル: configtest.py プロジェクト: sblaes/DbMigrations
 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
ファイル: configtest.py プロジェクト: sblaes/DbMigrations
 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
ファイル: configtest.py プロジェクト: sblaes/DbMigrations
 def testPutAndGet(self):
     conf = Config()
     conf.put('hello', 'world')
     self.assertTrue(conf.has('hello'))
     self.assertEqual('world', conf.get('hello'))