[Zope3-checkins] CVS: Zope3/src/zope/app/event/tests - placelesssetup.py:1.11

Steve Alexander steve@cat-box.net
Tue, 3 Jun 2003 10:53:18 -0400


Update of /cvs-repository/Zope3/src/zope/app/event/tests
In directory cvs.zope.org:/tmp/cvs-serv1355/src/zope/app/event/tests

Modified Files:
	placelesssetup.py 
Log Message:
New style implements.
Added a way to clear recorded events during a test.


=== Zope3/src/zope/app/event/tests/placelesssetup.py 1.10 => 1.11 ===
--- 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	Tue Jun  3 10:53:17 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)