summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests/test_configuration.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-01-19 02:08:12 +0000
committerChris McDonough <chrism@agendaless.com>2010-01-19 02:08:12 +0000
commit37bcb77a86b73151c781d8b0b8c2d3d4e14f5fe7 (patch)
treeb59bda2b0e5151ffe17b39f6fa6e82d6409b333e /repoze/bfg/tests/test_configuration.py
parent56971c5db0ba61bdc270da8e72c35708f93d9e11 (diff)
downloadpyramid-37bcb77a86b73151c781d8b0b8c2d3d4e14f5fe7.tar.gz
pyramid-37bcb77a86b73151c781d8b0b8c2d3d4e14f5fe7.tar.bz2
pyramid-37bcb77a86b73151c781d8b0b8c2d3d4e14f5fe7.zip
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``"
Diffstat (limited to 'repoze/bfg/tests/test_configuration.py')
-rw-r--r--repoze/bfg/tests/test_configuration.py14
1 files changed, 14 insertions, 0 deletions
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