From 37bcb77a86b73151c781d8b0b8c2d3d4e14f5fe7 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 19 Jan 2010 02:08:12 +0000 Subject: Bug Fixes --------- - When the ``Configurator`` is passed an instance of ``zope.component.registry.Components`` as a ``registry`` constructor argument, fix the instance up to have the attributes we expect of an instance of ``repoze.bfg.registry.Registry`` when ``setup_registry`` is called. This makes it possible to use the global Zope component registry as a BFG application registry. Documentation ------------- - Change renderings of ZCML directive documentation. - Add a narrative documentation chapter: "Using the Zope Component Architecture in ``repoze.bfg``" --- repoze/bfg/tests/test_configuration.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'repoze/bfg/tests/test_configuration.py') diff --git a/repoze/bfg/tests/test_configuration.py b/repoze/bfg/tests/test_configuration.py index ba306f26b..db960e2e9 100644 --- a/repoze/bfg/tests/test_configuration.py +++ b/repoze/bfg/tests/test_configuration.py @@ -173,6 +173,20 @@ class ConfiguratorTests(unittest.TestCase): self.assertEqual(config.registry.getUtility(IRendererFactory, 'yeah'), renderer) + def test_setup_registry_fixed(self): + class DummyRegistry(object): + def subscribers(self, events, name): + self.events = events + return events + def registerUtility(self, impl, iface, name=None, info=None): + pass + reg = DummyRegistry() + config = self._makeOne(reg) + config.setup_registry() + self.assertEqual(reg.has_listeners, True) + self.assertEqual(reg.notify(1), None) + self.assertEqual(reg.events, (1,)) + def test_setup_registry_custom_settings(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import ISettings -- cgit v1.2.3