[Zope3-checkins]
SVN: Zope3/branches/jim-adapter/src/zope/app/event/
moved clearEvents call don't so that we don't record registration
Jim Fulton
jim at zope.com
Sun Apr 2 12:59:32 EDT 2006
Log message for revision 66307:
moved clearEvents call don't so that we don't record registration
events generated by setUp.
Changed:
U Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py
U Zope3/branches/jim-adapter/src/zope/app/event/tests/placelesssetup.py
U Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py
-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py 2006-04-02 16:59:29 UTC (rev 66306)
+++ Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py 2006-04-02 16:59:31 UTC (rev 66307)
@@ -18,19 +18,16 @@
__docformat__ = 'restructuredtext'
from zope.interface import Interface, Attribute
+import zope.deferredimport
+import zope.component.interfaces
+zope.deferredimport.deprecated(
+ "IObjectEvent is now defined in zope.component.interfaces. "
+ "Importing IObjectEvent from zope.app.event will be disabled in Zope 3.5.",
+ IObjectEvent = 'zope.component.interfaces:IObjectEvent',
+ )
-class IObjectEvent(Interface):
- """An event related to an object.
-
- The object that generated this event is not necessarily the object
- refered to by location.
- """
-
- object = Attribute("The subject of the event.")
-
-
-class IObjectCreatedEvent(IObjectEvent):
+class IObjectCreatedEvent(zope.component.interfaces.IObjectEvent):
"""An object has been created.
The location will usually be ``None`` for this event."""
@@ -42,7 +39,7 @@
original = Attribute("The original from which the copy was made")
-class IObjectModifiedEvent(IObjectEvent):
+class IObjectModifiedEvent(zope.component.interfaces.IObjectEvent):
"""An object has been modified"""
Modified: Zope3/branches/jim-adapter/src/zope/app/event/tests/placelesssetup.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/tests/placelesssetup.py 2006-04-02 16:59:29 UTC (rev 66306)
+++ Zope3/branches/jim-adapter/src/zope/app/event/tests/placelesssetup.py 2006-04-02 16:59:31 UTC (rev 66307)
@@ -39,9 +39,9 @@
class PlacelessSetup(object):
def setUp(self):
- clearEvents()
ztapi.subscribe([None], None, events.append)
ztapi.subscribe([IObjectEvent], None, objectEventNotify)
+ clearEvents()
import zope.testing.cleanup
zope.testing.cleanup.addCleanUp(clearEvents)
Modified: Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py 2006-04-02 16:59:29 UTC (rev 66306)
+++ Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py 2006-04-02 16:59:31 UTC (rev 66307)
@@ -24,8 +24,6 @@
from zope.app.dublincore.interfaces import IZopeDublinCore
from zope.app.dublincore.annotatableadapter import ZDCAnnotatableAdapter
from zope.app.event.objectevent import ObjectModifiedEvent
-from zope.app.event.objectevent import ObjectAnnotationsModifiedEvent
-from zope.app.event.objectevent import ObjectContentModifiedEvent
from zope.app.event import objectevent
from zope.app.container.contained import Contained, ObjectRemovedEvent
from zope.app.container.interfaces import IContained, IObjectRemovedEvent
@@ -46,19 +44,6 @@
def testGetObject(self):
self.assertEqual(self.event.object, self.object)
-class TestObjectAnnotationsModifiedEvent(TestObjectModifiedEvent):
- klass = ObjectAnnotationsModifiedEvent
-
- def setUp(self):
- self.event = self.klass(self.object, deprecated_use=False)
-
-class TestObjectContentModifiedEvent(TestObjectModifiedEvent):
- klass = ObjectContentModifiedEvent
-
- def setUp(self):
- self.event = self.klass(self.object, deprecated_use=False)
-
-
class TestObjectEventNotifications(unittest.TestCase):
def setUp(self):
self.callbackTriggered = False
@@ -110,13 +95,13 @@
def tearDown(self):
tearDown()
-def setUpObjectEventDocTest(test) :
+def setUpObjectEventDocTest(test):
setUp()
ztapi.provideAdapter(IAttributeAnnotatable,
- IAnnotations, AttributeAnnotations)
+ IAnnotations, AttributeAnnotations)
ztapi.provideAdapter(IAnnotatable,
- IZopeDublinCore, ZDCAnnotatableAdapter)
+ IZopeDublinCore, ZDCAnnotatableAdapter)
def tearDownObjectEventDocTest(test) :
tearDown()
@@ -124,13 +109,11 @@
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(TestObjectModifiedEvent),
- unittest.makeSuite(TestObjectAnnotationsModifiedEvent),
- unittest.makeSuite(TestObjectContentModifiedEvent),
unittest.makeSuite(TestObjectEventNotifications),
doctest.DocTestSuite("zope.app.event.objectevent",
- setUp=setUpObjectEventDocTest,
- tearDown=tearDownObjectEventDocTest,
- optionflags=doctest.NORMALIZE_WHITESPACE),
+ setUp=setUpObjectEventDocTest,
+ tearDown=tearDownObjectEventDocTest,
+ optionflags=doctest.NORMALIZE_WHITESPACE),
))
if __name__=='__main__':
More information about the Zope3-Checkins
mailing list