Ejemplo n.º 1
0
 def test_define_then_load_registry(self):
     """Test loading the registry."""
     registry = openstack.common.config.registry.Registry()
     registry.define(section="logging",
                     name="log_file",
                     datatype=config.String,
                     default="default",
                     description="Test description.")
     registry.load(StringIO.StringIO(self.test_config))
     self.assertEquals("override", registry.get("logging", "log_file"))
Ejemplo n.º 2
0
 def test_load_registry_undefined(self):
     """Test loading the registry."""
     registry = openstack.common.config.registry.Registry()
     registry.load(StringIO.StringIO(self.test_config))
     with self.assertRaises(exceptions.NoSuchConfigOption):
         registry.get("logging", "blah")