[Zope3-checkins] CVS: Zope3/src/zope/app/utility/browser/tests - test_registered.py:1.3

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Apr 17 10:33:48 EDT 2004


Update of /cvs-repository/Zope3/src/zope/app/utility/browser/tests
In directory cvs.zope.org:/tmp/cvs-serv17003/src/zope/app/utility/browser/tests

Modified Files:
	test_registered.py 
Log Message:


Get rid of getRegisteredMatching().




=== Zope3/src/zope/app/utility/browser/tests/test_registered.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/utility/browser/tests/test_registered.py:1.2	Fri Mar 19 15:26:37 2004
+++ Zope3/src/zope/app/utility/browser/tests/test_registered.py	Sat Apr 17 10:33:47 2004
@@ -44,8 +44,11 @@
 
     implements(IStub)
 
-    def __init__(self, url=None):
+    def __init__(self, name, provided, url=None):
         self.url = url
+        self.name = name
+        self.provided = provided
+        self.component = self
 
     # registration registry
     def active(self):
@@ -59,7 +62,7 @@
 
     # registration
     def getComponent(self):
-        return self
+        return self.component
 
     def usageSummary(self):
         return ""
@@ -69,16 +72,17 @@
         return self.context.url
 
 class StubLocalUtilityService:
-    def getRegisteredMatching(self):
-        return [
-            # (iface, name, configregistry)
-            (IFoo, '', Stub("1")),
-            (IFoo, 'myfoo-1', Stub("2")),
-            (IFoo, 'myfoo-2', Stub()),
-            (IBar, '', Stub()),
-            (IBar, 'mybar-1', Stub("3"))
-            ]
+    def registrations(self, localOnly=False):
+        return iter([
+            Stub('', IFoo, "1"),
+            Stub('myfoo-1', IFoo, "2"),
+            Stub('myfoo-2', IFoo),
+            Stub('', IBar),
+            Stub('mybar-1', IBar, "3")
+            ])
 
+    def queryRegistrationsFor(self, registration):
+        return registration
 
 class UtilitiesView(Utilities, BrowserView):
     """Adding BrowserView to Utilities; this is usually done by ZCML."""




More information about the Zope3-Checkins mailing list