示例#1
0
 def test_import_opt(self):
     self.fconf = cfgfilter.ConfigFilter(cfg.CONF)
     self.assertFalse(hasattr(self.fconf, 'blaa'))
     self.fconf.import_opt('blaa', 'tests.testmods.blaa_opt')
     self.assertTrue(hasattr(self.fconf, 'blaa'))
示例#2
0
 def test_import_group(self):
     self.fconf = cfgfilter.ConfigFilter(cfg.CONF)
     self.assertFalse(hasattr(self.fconf, 'baar'))
     self.fconf.import_group('baar', 'tests.testmods.baar_baa_opt')
     self.assertTrue(hasattr(self.fconf, 'baar'))
     self.assertTrue(hasattr(self.fconf.baar, 'baa'))
示例#3
0
 def setUp(self):
     super(ConfigFilterTestCase, self).setUp()
     self.conf = cfg.ConfigOpts()
     self.fconf = cfgfilter.ConfigFilter(self.conf)
示例#4
0
 def test_import_opt_in_group(self):
     self.fconf = cfgfilter.ConfigFilter(cfg.CONF)
     self.assertFalse(hasattr(self.fconf, 'bar'))
     self.fconf.import_opt('foo', 'tests.testmods.bar_foo_opt', group='bar')
     self.assertTrue(hasattr(self.fconf, 'bar'))
     self.assertTrue(hasattr(self.fconf.bar, 'foo'))