[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_eventservice.py:1.20.8.1
Marius Gedminas
mgedmin@codeworks.lt
Fri, 16 May 2003 04:15:31 -0400
Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv30351/src/zope/app/services/tests
Modified Files:
Tag: stevea-decorators-branch
test_eventservice.py
Log Message:
Update one of EventService tests to cope with additional events caused by
context decoration.
=== Zope3/src/zope/app/services/tests/test_eventservice.py 1.20 => 1.20.8.1 ===
--- Zope3/src/zope/app/services/tests/test_eventservice.py:1.20 Thu May 1 15:35:35 2003
+++ Zope3/src/zope/app/services/tests/test_eventservice.py Fri May 16 04:15:30 2003
@@ -253,14 +253,20 @@
self.assertEqual(self.folder1Subscriber.notified, 0)
self.assertEqual(self.folder1_1Subscriber.notified, 1)
- # Now, put folder1Subscriber back. It should not be notified
- # now, because it was removed as a bad subscriber.
+ # Now, put folder1Subscriber back. This incidentally fires off a
+ # ObjectAddedEvent, since self.folder1 is decorated with a context
+ # decorator.
self.folder1.setObject('folder1Subscriber', folder1Subscriber)
-
- publish(self.folder1, ObjectAddedEvent(None, '/foo'))
self.assertEqual(self.rootFolderSubscriber.notified, 2)
self.assertEqual(self.folder1Subscriber.notified, 0)
self.assertEqual(self.folder1_1Subscriber.notified, 2)
+
+ # folder1Subscriber should not be notified now, because it was removed
+ # as a bad subscriber.
+ publish(self.folder1, ObjectAddedEvent(None, '/foo'))
+ self.assertEqual(self.rootFolderSubscriber.notified, 3)
+ self.assertEqual(self.folder1Subscriber.notified, 0)
+ self.assertEqual(self.folder1_1Subscriber.notified, 3)
def testByPathExplicit(self):
# test complex interaction, with hubids available but explicitly