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'))
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'))
def setUp(self): super(ConfigFilterTestCase, self).setUp() self.conf = cfg.ConfigOpts() self.fconf = cfgfilter.ConfigFilter(self.conf)
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'))