[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Find/tests - testFind.py:1.1.2.2

Gary Poster garyposter@earthlink.net
Fri, 17 May 2002 13:16:14 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/Find/tests
In directory cvs.zope.org:/tmp/cvs-serv15153/App/OFS/Container/Find/tests

Modified Files:
      Tag: Zope-3x-branch
	testFind.py 
Log Message:
1) Fixed some of my own (wrapping) errors in CA and Traversal
2) added IBindingAware interface for services that need to know when they are bound and unbound to a local service manager
3) in subscribables, made event_types into event_type (YAGNI)
4) in subscribables, added ability to unsubscribe per subscription, not just whole-hog
5) in subscribables, added ability to query subscribable for subscriptions of a given subscriber
6) made ISubscribable extremely verbose, to hopefully describe exactly what's going on (see it for more smaller changes)
7) added ISubscriptionAware interface for objects that need to know when they have been subscribed and unsubscribed
8) built out local event service; once there are some views and once I have some more robust tests this *prototype* should by ready to fly.  Note that it is currently a standard service that can be added to any service manager, and thus the design does attempt to address many of the nested service manager issues.
9) as part of this, created the first indirect subscriber (all placeful
subscriptions will usually need to use indirect subscribers in order to retain their context when events are fired): PathSubscriber
10) removed an endless loop between local service managers and  ZopeSecurityPolicy in which both needed the other to function: ZopeSecurityPolicy now explicitly asks for adapters from the global service manager
11) unintentionally retained some of the "default=ComponentLookupError"-type argument signatures from my sandbox, but only within Container and Folder; I won't worry about undoing it though (unless I am otherwise requested) since it seems these interfaces are due for a dict-like overhaul anyway.

Also, if anyone needs a local event service setup for other tests (like the ObjectHub, for instance) see the LocalEventService/tests/EventSetup.py

more tests on the way for the local event service, and for the changes to the subscribable interface



=== Zope3/lib/python/Zope/App/OFS/Container/Find/tests/testFind.py 1.1.2.1 => 1.1.2.2 ===
 
 from unittest import TestCase, TestSuite, main, makeSuite
-from Zope.App.OFS.Container.IContainer import IReadContainer, _RAISE_KEYERROR
+from Zope.App.OFS.Container.IContainer import IReadContainer
 from Zope.App.OFS.Container.Find.IFind import IObjectFindFilter
 from Zope.App.OFS.Container.Find.FindAdapter\
      import FindAdapter, SimpleIdFindFilter
@@ -39,11 +39,11 @@
     def objectItems(self):
         return [(object._id, object) for object in self._objects]
 
-    def getObject(self, id, default=_RAISE_KEYERROR):
+    def getObject(self, id, default=KeyError):
         for object in self._objects:
             if object._id == id:
                 return object
-        if default is _RAISE_KEYERROR:
+        if default is KeyError:
             raise KeyError, "Could not find %s" % id
         else:
             return default