diff options
| author | Chris McDonough <chrism@agendaless.com> | 2008-11-11 12:33:24 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2008-11-11 12:33:24 +0000 |
| commit | 720c8893749556208296af0ee5adcfe9eb373ec7 (patch) | |
| tree | 6f75b271b843d0f46dfccb9b6d6d7ea3c0febc26 /repoze/bfg/tests/test_testing.py | |
| parent | 6d4015c5d9f5ddeb60d162d385579176a44d8be3 (diff) | |
| download | pyramid-720c8893749556208296af0ee5adcfe9eb373ec7.tar.gz pyramid-720c8893749556208296af0ee5adcfe9eb373ec7.tar.bz2 pyramid-720c8893749556208296af0ee5adcfe9eb373ec7.zip | |
- Allow ``testing.registerEventListener`` to be used with Zope 3
style "object events" (subscribers accept more than a single event
argument). We extend the list with the arguments, rather than
append.
Prep for 0.4.7.
Diffstat (limited to 'repoze/bfg/tests/test_testing.py')
| -rw-r--r-- | repoze/bfg/tests/test_testing.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_testing.py b/repoze/bfg/tests/test_testing.py index abd955c96..598436c1a 100644 --- a/repoze/bfg/tests/test_testing.py +++ b/repoze/bfg/tests/test_testing.py @@ -74,6 +74,23 @@ class TestTestingFunctions(unittest.TestCase, PlacelessSetup): self.assertEqual(L[0], event) dispatch(object()) self.assertEqual(len(L), 1) + + def test_registerEventListener_multiple(self): + from repoze.bfg import testing + from zope.interface import implements + from zope.interface import Interface + class IEvent(Interface): + pass + class Event: + object = 'foo' + implements(IEvent) + L = testing.registerEventListener((Interface, IEvent)) + from zope.component.event import objectEventNotify + event = Event() + objectEventNotify(event) + self.assertEqual(len(L), 2) + self.assertEqual(L[0], 'foo') + self.assertEqual(L[1], event) def test_registerEventListener_defaults(self): from repoze.bfg import testing |
