[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - objecthubsetup.py:1.12 test_objecthub.py:1.11
Steve Alexander
steve@cat-box.net
Sat, 7 Jun 2003 03:23:53 -0400
Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv11146/src/zope/app/services/tests
Modified Files:
objecthubsetup.py test_objecthub.py
Log Message:
Fixed collector issue http://collector.zope.org/Zope3-dev/163.
=== Zope3/src/zope/app/services/tests/objecthubsetup.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/services/tests/objecthubsetup.py:1.11 Fri Jun 6 15:42:56 2003
+++ Zope3/src/zope/app/services/tests/objecthubsetup.py Sat Jun 7 03:23:52 2003
@@ -22,7 +22,7 @@
from zope.app.services.servicenames import HubIds
from zope.app.traversing import traverse, canonicalPath
-from zope.app.interfaces.event import IObjectAddedEvent
+from zope.app.interfaces.event import IObjectAddedEvent, IObjectMovedEvent
from zope.app.interfaces.event import ISubscriber
from zope.interface import implements
@@ -78,7 +78,9 @@
def notify(self, event):
LoggingSubscriber.notify(self, event)
- if IObjectAddedEvent.isImplementedBy(event):
+ # The policy is to register on object adds and object copies.
+ if (IObjectAddedEvent.isImplementedBy(event)
+ and not IObjectMovedEvent.isImplementedBy(event)):
self.hub.register(event.location)
class ObjectHubSetup(EventSetup):
@@ -94,7 +96,7 @@
self.rootFolder.setObject('logging_subscriber', subscriber)
self.subscriber = traverse(self.rootFolder, 'logging_subscriber')
self.object_hub.subscribe(self.subscriber)
-
+
def setUp(self):
EventSetup.setUp(self)
self.object_hub = getService(self.rootFolder, HubIds)
=== Zope3/src/zope/app/services/tests/test_objecthub.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/services/tests/test_objecthub.py:1.10 Sat Jun 7 01:32:01 2003
+++ Zope3/src/zope/app/services/tests/test_objecthub.py Sat Jun 7 03:23:52 2003
@@ -460,7 +460,6 @@
hub.notify(added_event)
hubid = hub.getHubId(location)
-
hub.notify(moved_event)
location_from_hub = hub.getPath(hubid)