[Zope3-checkins] CVS: Zope3/src/zope/app/event/tests - subscriber.py:1.3 test_eventpublisher.py:1.4 test_globaleventchannel.py:1.3
Steve Alexander
steve@cat-box.net
Sat, 7 Jun 2003 02:37:56 -0400
Update of /cvs-repository/Zope3/src/zope/app/event/tests
In directory cvs.zope.org:/tmp/cvs-serv4294/src/zope/app/event/tests
Modified Files:
subscriber.py test_eventpublisher.py
test_globaleventchannel.py
Log Message:
updated to use new-style interface declarations
=== Zope3/src/zope/app/event/tests/subscriber.py 1.2 => 1.3 ===
--- 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 Sat Jun 7 02:37:25 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.4 ===
--- 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 Sat Jun 7 02:37:25 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.3 ===
--- 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 Sat Jun 7 02:37:25 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))