[Zope-Checkins] SVN: Products.Five/branches/1.3/tests/event.txt Add
event.txt test that I missed last time.
Stefan H. Holek
stefan at epy.co.at
Thu Jun 21 03:27:23 EDT 2007
Log message for revision 76874:
Add event.txt test that I missed last time.
Changed:
U Products.Five/branches/1.3/tests/event.txt
-=-
Modified: Products.Five/branches/1.3/tests/event.txt
===================================================================
--- Products.Five/branches/1.3/tests/event.txt 2007-06-21 06:46:21 UTC (rev 76873)
+++ Products.Five/branches/1.3/tests/event.txt 2007-06-21 07:27:23 UTC (rev 76874)
@@ -60,6 +60,7 @@
>>> from zope.app.event.interfaces import IObjectEvent
>>> from zope.app.container.interfaces import IObjectMovedEvent
+ >>> from zope.app.event.interfaces import IObjectCopiedEvent
>>> from OFS.interfaces import IObjectWillBeMovedEvent
>>> from OFS.interfaces import IObjectClonedEvent
>>> from OFS.interfaces import IItem
@@ -67,6 +68,7 @@
... print event.__class__.__name__, object.getId()
>>> def printObjectEventExceptSome(object, event):
... if (IObjectMovedEvent.providedBy(event) or
+ ... IObjectCopiedEvent.providedBy(event) or
... IObjectWillBeMovedEvent.providedBy(event) or
... IObjectClonedEvent.providedBy(event)):
... return
@@ -74,6 +76,7 @@
>>> from zope.component import provideHandler
>>> provideHandler(printObjectEvent, (IItem, IObjectMovedEvent))
+ >>> provideHandler(printObjectEvent, (IItem, IObjectCopiedEvent))
>>> provideHandler(printObjectEvent, (IItem, IObjectWillBeMovedEvent))
>>> provideHandler(printObjectEvent, (IItem, IObjectClonedEvent))
>>> provideHandler(printObjectEventExceptSome, (None, IObjectEvent))
@@ -134,6 +137,7 @@
>>> res = folder.manage_clone(folder.marine, 'tank')
ObjectCopiedEvent tank
+ ObjectCopiedEvent dog
ObjectWillBeAddedEvent tank
ObjectWillBeAddedEvent dog
ObjectAddedEvent tank
@@ -283,6 +287,7 @@
>>> res = folder.manage_clone(folder.pluto, 'mickey')
ObjectCopiedEvent mickey
+ ObjectCopiedEvent donald
ObjectWillBeAddedEvent mickey
ObjectWillBeAddedEvent donald
ObjectAddedEvent mickey
@@ -415,6 +420,7 @@
>>> res = folder.manage_clone(folder.firefly, 'serenity')
ObjectCopiedEvent serenity
+ ObjectCopiedEvent mel
ObjectWillBeAddedEvent serenity
ObjectWillBeAddedEvent mel
ObjectAddedEvent serenity
More information about the Zope-Checkins
mailing list