From 51dcd955690881d7e61c01a81391edf1be3ae3e4 Mon Sep 17 00:00:00 2001 From: Malthe Borch Date: Thu, 2 Oct 2008 22:37:58 +0000 Subject: Make sure the IWSGIApplicationCreatedEvent interface actually implements the contract (and test this). --- repoze/bfg/events.py | 4 ++++ repoze/bfg/tests/test_events.py | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/repoze/bfg/events.py b/repoze/bfg/events.py index b43fd5753..54f60c294 100644 --- a/repoze/bfg/events.py +++ b/repoze/bfg/events.py @@ -32,3 +32,7 @@ class WSGIApplicationCreatedEvent(object): implements(IWSGIApplicationCreatedEvent) def __init__(self, app): self.app = app + + @property + def object(self): + return self.app diff --git a/repoze/bfg/tests/test_events.py b/repoze/bfg/tests/test_events.py index 770f1afeb..f3da5d6a6 100644 --- a/repoze/bfg/tests/test_events.py +++ b/repoze/bfg/tests/test_events.py @@ -52,6 +52,14 @@ class NewResponseEventTests(unittest.TestCase): inst = self._makeOne(response) self.assertEqual(inst.response, response) +class WSGIAppEventTests(unittest.TestCase): + def test_class_implements(self): + from repoze.bfg.events import WSGIApplicationCreatedEvent + event = WSGIApplicationCreatedEvent(object()) + from repoze.bfg.interfaces import IWSGIApplicationCreatedEvent + from zope.interface.verify import verifyClass + verifyClass(IWSGIApplicationCreatedEvent, event) + class DummyRequest: pass -- cgit v1.2.3