summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests
diff options
context:
space:
mode:
authorMalthe Borch <mborch@gmail.com>2008-08-29 18:24:03 +0000
committerMalthe Borch <mborch@gmail.com>2008-08-29 18:24:03 +0000
commit003e522b5784f50bc6f41168d0b087cc25d2aa4f (patch)
treec9d2386ab60f5cccb8124059ccc01f69c9d98be8 /repoze/bfg/tests
parent7f4f1a3b3acd01f5d24dd70a40154509fe0c8760 (diff)
downloadpyramid-003e522b5784f50bc6f41168d0b087cc25d2aa4f.tar.gz
pyramid-003e522b5784f50bc6f41168d0b087cc25d2aa4f.tar.bz2
pyramid-003e522b5784f50bc6f41168d0b087cc25d2aa4f.zip
Added event notification after WSGI application is created and configured.
Diffstat (limited to 'repoze/bfg/tests')
-rw-r--r--repoze/bfg/tests/test_router.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/repoze/bfg/tests/test_router.py b/repoze/bfg/tests/test_router.py
index 381091d56..87dcbba66 100644
--- a/repoze/bfg/tests/test_router.py
+++ b/repoze/bfg/tests/test_router.py
@@ -264,7 +264,7 @@ class RouterTests(unittest.TestCase, PlacelessSetup):
self.assertEqual(request_events[0].request.environ, environ)
self.assertEqual(len(response_events), 1)
self.assertEqual(response_events[0].response, response)
-
+
class MakeAppTests(unittest.TestCase, PlacelessSetup):
def setUp(self):
PlacelessSetup.setUp(self)
@@ -284,6 +284,19 @@ class MakeAppTests(unittest.TestCase, PlacelessSetup):
self.assertEqual(app.registry.__name__, 'repoze.bfg.tests.fixtureapp')
self.assertEqual(app.root_policy, rootpolicy)
+ def test_event(self):
+ def subscriber(event):
+ event.app.created = True
+ from zope.component import getGlobalSiteManager
+ from repoze.bfg.interfaces import IWSGIApplicationCreatedEvent
+ getGlobalSiteManager().registerHandler(
+ subscriber, (IWSGIApplicationCreatedEvent,))
+ from repoze.bfg.tests import fixtureapp
+ make_app = self._getFUT()
+ rootpolicy = make_rootpolicy(None)
+ app = make_app(rootpolicy, fixtureapp)
+ assert app.created is True
+
class DummyContext:
pass