[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - eventsetup.py:1.5 test_eventservice.py:1.4

Steve Alexander steve@cat-box.net
Mon, 27 Jan 2003 13:32:23 -0500


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

Modified Files:
	eventsetup.py test_eventservice.py 
Log Message:
forgot some files of my eventservice work.


=== Zope3/src/zope/app/services/tests/eventsetup.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/services/tests/eventsetup.py:1.4	Mon Dec 30 09:03:17 2002
+++ Zope3/src/zope/app/services/tests/eventsetup.py	Mon Jan 27 13:31:51 2003
@@ -24,7 +24,7 @@
 from zope.app.interfaces.services.event import ISubscriptionService
 
 class EventSetup(PlacefulSetup):
-    
+
     def setUp(self):
         PlacefulSetup.setUp(self)
         self.buildFolders()


=== Zope3/src/zope/app/services/tests/test_eventservice.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/services/tests/test_eventservice.py:1.3	Mon Dec 30 09:03:17 2002
+++ Zope3/src/zope/app/services/tests/test_eventservice.py	Mon Jan 27 13:31:51 2003
@@ -62,10 +62,10 @@
 
 class DumbObjectHub:
     __implements__ = IObjectHub
-    
+
     def __init__(self):
         self.lib = []
-    
+
     def getObject(self, hubid):
         try:
             return self.lib[hubid]
@@ -80,7 +80,7 @@
 
 
 class DummySubscriptionAwareSubscriber(DummySubscriber):
-    __implements__ = ISubscribingAware
+    __implements__ = ISubscribingAware, ISubscriber
 
     def subscribedTo(self, subscribable, event_type, filter):
         self.subscribable = subscribable
@@ -93,7 +93,7 @@
         self.un_filter = filter
 
 class TestEventPublisher(EventSetup, TestCase):
-    
+
     def setUp(self):
         EventSetup.setUp(self)
         #sm = getServiceManager(None)
@@ -129,7 +129,7 @@
             self.folder1_1["folder1_1Subscriber"],
             self.folder1_1,
             name="folder1_1Subscriber")
-    
+
     def _createHubIdSubscribers(self):
         self._createSubscribers()
         self.objectHub.lib = [self.rootFolderSubscriber,
@@ -315,11 +315,11 @@
 
         self.assertEqual(events.listSubscriptions(self.rootFolderSubscriber),
                          [])
-    
+
     def testPathListSubscriptions1(self):
         self._createSubscribers()
         self._testListSubscriptions1()
-    
+
     def testHubIdListSubscriptions1(self):
         self._createHubIdSubscribers()
         self._testListSubscriptions1()
@@ -333,11 +333,11 @@
         self.assertEqual([(IObjectAddedEvent,None)],
                          getSubscriptionService(self.rootFolder)
                             .listSubscriptions(self.rootFolderSubscriber))
-    
+
     def testPathListSubscriptions2(self):
         self._createSubscribers()
         self._testListSubscriptions2()
-    
+
     def testHubIdListSubscriptions2(self):
         self._createHubIdSubscribers()
         self._testListSubscriptions2()
@@ -352,11 +352,11 @@
                          getSubscriptionService(self.rootFolder)
                             .listSubscriptions(self.rootFolderSubscriber,
                                                IObjectRemovedEvent))
-    
+
     def testPathListSubscriptions3(self):
         self._createSubscribers()
         self._testListSubscriptions3()
-    
+
     def testHubIdListSubscriptions3(self):
         self._createHubIdSubscribers()
         self._testListSubscriptions3()
@@ -385,11 +385,11 @@
         self.assertEqual([(IObjectAddedEvent,None)],
                          getSubscriptionService(self.rootFolder)
                             .listSubscriptions(self.rootFolderSubscriber))
-    
+
     def testPathListSubscriptions5(self):
         self._createSubscribers()
         self._testListSubscriptions5()
-    
+
     def testHubIdListSubscriptions5(self):
         self._createHubIdSubscribers()
         self._testListSubscriptions5()
@@ -404,11 +404,11 @@
                          getSubscriptionService(self.rootFolder)
                             .listSubscriptions(self.rootFolderSubscriber,
                                                IObjectRemovedEvent))
-    
+
     def testPathListSubscriptions6(self):
         self._createSubscribers()
         self._testListSubscriptions6()
-    
+
     def testHubIdListSubscriptions6(self):
         self._createHubIdSubscribers()
         self._testListSubscriptions6()
@@ -418,11 +418,11 @@
         subscribe(self.rootFolderSubscriber)
         publish(self.rootFolder, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.rootFolderSubscriber.notified, 1)
-    
+
     def testPathSubscribe1(self):
         self._createSubscribers()
         self._testSubscribe1()
-    
+
     def testHubIdSubscribe1(self):
         self._createHubIdSubscribers()
         self._testSubscribe1()
@@ -435,11 +435,11 @@
             )
         publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.rootFolderSubscriber.notified, 1)
-    
+
     def testPathSubscribe2(self):
         self._createSubscribers()
         self._testSubscribe2()
-    
+
     def testHubIdSubscribe2(self):
         self._createHubIdSubscribers()
         self._testSubscribe2()
@@ -453,11 +453,11 @@
             )
         publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.rootFolderSubscriber.notified, 1)
-    
+
     def testPathSubscribe3(self):
         self._createSubscribers()
         self._testSubscribe3()
-    
+
     def testHubIdSubscribe3(self):
         self._createHubIdSubscribers()
         self._testSubscribe3()
@@ -472,11 +472,11 @@
             )
         publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.rootFolderSubscriber.notified, 0)
-    
+
     def testPathSubscribe4(self):
         self._createSubscribers()
         self._testSubscribe4()
-    
+
     def testHubIdSubscribe4(self):
         self._createHubIdSubscribers()
         self._testSubscribe4()
@@ -491,11 +491,11 @@
             )
         publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.rootFolderSubscriber.notified, 0)
-    
+
     def testPathSubscribe5(self):
         self._createSubscribers()
         self._testSubscribe5()
-    
+
     def testHubIdSubscribe5(self):
         self._createHubIdSubscribers()
         self._testSubscribe5()
@@ -509,11 +509,11 @@
             )
         publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.rootFolderSubscriber.notified, 1)
-    
+
     def testPathSubscribe6(self):
         self._createSubscribers()
         self._testSubscribe6()
-    
+
     def testHubIdSubscribe6(self):
         self._createHubIdSubscribers()
         self._testSubscribe6()
@@ -531,11 +531,11 @@
             )
         publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.rootFolderSubscriber.notified, 1)
-    
+
     def testPathSubscribe7(self):
         self._createSubscribers()
         self._testSubscribe7()
-    
+
     def testHubIdSubscribe7(self):
         self._createHubIdSubscribers()
         self._testSubscribe7()
@@ -558,15 +558,15 @@
             )
         publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.rootFolderSubscriber.notified, 2)
-    
+
     def testPathSubscribe8(self):
         self._createSubscribers()
         self._testSubscribe8()
-    
+
     def testHubIdSubscribe8(self):
         self._createHubIdSubscribers()
         self._testSubscribe8()
-    
+
     def _testUnsubscribe1(self):
         # Test unsubscribe method
         subscribe(
@@ -579,11 +579,11 @@
             )
         publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.rootFolderSubscriber.notified, 1)
-    
+
     def testPathUnsubscribe1(self):
         self._createSubscribers()
         self._testUnsubscribe1()
-    
+
     def testHubIdUnsubscribe1(self):
         self._createHubIdSubscribers()
         self._testUnsubscribe1()
@@ -596,11 +596,11 @@
                           IObjectEvent)
         self.assertEqual(None,
                          unsubscribe(self.rootFolderSubscriber))
-    
+
     def testPathUnsubscribe2(self):
         self._createSubscribers()
         self._testUnsubscribe2()
-    
+
     def testHubIdUnsubscribe2(self):
         self._createHubIdSubscribers()
         self._testUnsubscribe2()
@@ -654,20 +654,20 @@
         publish(self.folder1_1_1, event)
         self.assertEqual(subscriber.notified, 7)
         self.assertEqual(subscriber2.notified, 4)
-    
+
     def testPathUnsubscribe3(self):
         self._createSubscribers()
         self._testUnsubscribe3()
-    
+
     def testHubIdUnsubscribe3(self):
         self._createHubIdSubscribers()
         self._testUnsubscribe3()
-    
+
     def testPathUnsubscribe4(self):
         self._createNestedServices()
         self._createSubscribers()
         self._testUnsubscribe3()
-    
+
     def testHubIdUnsubscribe4(self):
         self._createNestedServices()
         self._createHubIdSubscribers()
@@ -680,11 +680,11 @@
         self.assertEqual(subscriber.notified, 0)
         publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(subscriber.notified, 1)
-    
+
     def testPathPublish1(self):
         self._createSubscribers()
         self._testpublish1()
-    
+
     def testHubIdPublish1(self):
         self._createHubIdSubscribers()
         self._testpublish1()
@@ -704,11 +704,11 @@
             )
         publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(subscriber.notified, 2)
-    
+
     def testPathPublish2(self):
         self._createSubscribers()
         self._testpublish2()
-    
+
     def testHubIdPublish2(self):
         self._createHubIdSubscribers()
         self._testpublish2()
@@ -727,11 +727,11 @@
             )
         publish(self.folder1_1_1, DummyEvent())
         self.assertEqual(subscriber.notified, 2)
-    
+
     def testPathPublish3(self):
         self._createSubscribers()
         self._testpublish3()
-    
+
     def testHubIdPublish3(self):
         self._createHubIdSubscribers()
         self._testpublish3()
@@ -750,11 +750,11 @@
             )
         publish(self.folder1_1_1, ObjectEvent())
         self.assertEqual(subscriber.notified, 1)
-    
+
     def testPathPublish4(self):
         self._createSubscribers()
         self._testpublish4()
-    
+
     def testHubIdPublish4(self):
         self._createHubIdSubscribers()
         self._testpublish4()
@@ -778,7 +778,7 @@
         configuration = ServiceConfiguration("Events", path)
         default['configure'].setObject("myEventServiceDir", configuration)
         traverse(default, 'configure/1').status = Active
-        
+
         configuration = ServiceConfiguration("Subscription", path)
         default['configure'].setObject("mySubscriptionServiceDir",
                                        configuration)
@@ -838,7 +838,7 @@
         publish(self.rootFolder, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.folder1Subscriber.notified, 1)
         self.assertEqual(self.folder1_1Subscriber.notified, 1)
-        
+
         configuration = sm.queryConfigurations("Subscription").active()
         configuration.status = Registered