[Zope3-checkins] CVS: Zope3/src/zope/app/event/tests - placelesssetup.py:1.10.10.1 subscriber.py:1.2.24.1 test_eventpublisher.py:1.3.10.1 test_globaleventchannel.py:1.2.24.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:24:03 -0400
Update of /cvs-repository/Zope3/src/zope/app/event/tests
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/app/event/tests
Modified Files:
Tag: cw-mail-branch
placelesssetup.py subscriber.py test_eventpublisher.py
test_globaleventchannel.py
Log Message:
Synced up with HEAD
=== Zope3/src/zope/app/event/tests/placelesssetup.py 1.10 => 1.10.10.1 ===
--- Zope3/src/zope/app/event/tests/placelesssetup.py:1.10 Thu May 1 15:35:16 2003
+++ Zope3/src/zope/app/event/tests/placelesssetup.py Sun Jun 22 10:23:01 2003
@@ -21,11 +21,12 @@
from zope.app.services.servicenames import EventPublication
from zope.app.interfaces.event import IPublisher, ISubscriber
from zope.app.event.globalservice import eventPublisher
+from zope.interface import implements
events = []
class EventRecorderClass:
- __implements__ = ISubscriber
+ implements(ISubscriber)
notify = events.append
@@ -42,6 +43,9 @@
return r
+def clearEvents():
+ del events[:]
+
class PlacelessSetup:
def setUp(self):
@@ -52,5 +56,5 @@
defineService(EventPublication, IPublisher)
provideService(EventPublication, eventPublisher)
- del events[:]
+ clearEvents()
eventPublisher.globalSubscribe(EventRecorder)
=== Zope3/src/zope/app/event/tests/subscriber.py 1.2 => 1.2.24.1 ===
--- Zope3/src/zope/app/event/tests/subscriber.py:1.2 Mon Jan 27 13:31:52 2003
+++ Zope3/src/zope/app/event/tests/subscriber.py Sun Jun 22 10:23:01 2003
@@ -20,10 +20,11 @@
"""
from zope.app.interfaces.event import IFilter, ISubscriber
+from zope.interface import implements
class DummySubscriber:
- __implements__ = ISubscriber
+ implements(ISubscriber)
def __init__(self):
self.notified = 0
@@ -34,8 +35,8 @@
subscriber = DummySubscriber()
class DummyFilter:
- __implements__ = IFilter
-
+ implements(IFilter)
+
def __init__(self,value=1):
self.value = value
=== Zope3/src/zope/app/event/tests/test_eventpublisher.py 1.3 => 1.3.10.1 ===
--- Zope3/src/zope/app/event/tests/test_eventpublisher.py:1.3 Thu May 1 15:35:16 2003
+++ Zope3/src/zope/app/event/tests/test_eventpublisher.py Sun Jun 22 10:23:01 2003
@@ -29,14 +29,15 @@
from zope.component.tests.placelesssetup import PlacelessSetup
from zope.app.event.tests.subscriber import DummySubscriber, DummyFilter
+from zope.interface import implements
class DummyEvent:
- __implements__ = IObjectAddedEvent, IObjectRemovedEvent
+ implements(IObjectAddedEvent, IObjectRemovedEvent)
class ObjectEvent:
- __implements__ = IObjectEvent
+ implements(IObjectEvent)
class TestEventService(PlacelessSetup, unittest.TestCase):
=== Zope3/src/zope/app/event/tests/test_globaleventchannel.py 1.2 => 1.2.24.1 ===
--- Zope3/src/zope/app/event/tests/test_globaleventchannel.py:1.2 Mon Jan 27 13:16:57 2003
+++ Zope3/src/zope/app/event/tests/test_globaleventchannel.py Sun Jun 22 10:23:01 2003
@@ -18,7 +18,7 @@
from unittest import TestCase, TestSuite, main, makeSuite
from zope.app.interfaces.event import IEvent, ISubscribingAware, ISubscriber
-from zope.interface import Interface
+from zope.interface import Interface, implements
from zope.component.tests.placelesssetup import PlacelessSetup
from zope.component.tests.components import RecordingAdapter
from zope.component.adapter import provideAdapter
@@ -39,22 +39,22 @@
pass
class SomeEvent:
- __implements__ = ISomeEvent
+ implements(ISomeEvent)
class SomeSubEvent:
- __implements__ = ISomeSubEvent
+ implements(ISomeSubEvent)
class SomeOtherEvent:
- __implements__ = ISomeOtherEvent
+ implements(ISomeOtherEvent)
class SubscriberStub:
- __implements__ = ISubscriberStub
+ implements(ISubscriberStub)
received = None
def notify(self, event):
self.received = event
class NonSubscriberStub:
- __implements__ = INonSubscriberStub
+ implements(INonSubscriberStub)
class Test(PlacelessSetup, TestCase):
@@ -105,7 +105,7 @@
"Event was not filtered")
class SubAware(RecordingAdapter):
- __implements__ = ISubscribingAware
+ implements(ISubscribingAware)
def subscribedTo(self, subscribable, event_type, filter):
self.record.append(('subscribed', self.context, subscribable,
@@ -151,7 +151,7 @@
self.ec = GlobalEventPublisher()
class SubscriberAdapter(RecordingAdapter):
- __implements__ = ISubscriber
+ implements(ISubscriber)
def notify(self, event):
self.record.append(('notified', self.context, event))