[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_principalannotation.py:1.10 test_serviceregistration.py:1.4

Jim Fulton jim at zope.com
Sat Mar 6 11:51:01 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv11249/src/zope/app/services/tests

Modified Files:
	test_principalannotation.py test_serviceregistration.py 
Log Message:
Converted most getAdapter calls to use interface calls instead.


=== Zope3/src/zope/app/services/tests/test_principalannotation.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/services/tests/test_principalannotation.py:1.9	Fri Nov 21 12:12:13 2003
+++ Zope3/src/zope/app/services/tests/test_principalannotation.py	Sat Mar  6 11:50:30 2004
@@ -25,7 +25,6 @@
 from zope.app.interfaces.services.principalannotation import \
      IPrincipalAnnotationService
 from zope.app.tests import ztapi
-from zope.component import getAdapter
 from zope.app.interfaces.annotation import IAnnotations
 from zope.app.interfaces.security import IPrincipal
 from zope.app.tests import setup
@@ -102,9 +101,9 @@
         p = Principal('somebody')
         ztapi.provideAdapter(IPrincipal, IAnnotations,
                              AnnotationsForPrincipal(self.svc))
-        annotations = getAdapter(p, IAnnotations)
+        annotations = IAnnotations(p)
         annotations["test"] = "bar"
-        annotations = getAdapter(p, IAnnotations)
+        annotations = IAnnotations(p)
         self.assertEquals(annotations["test"], "bar")
 
 


=== Zope3/src/zope/app/services/tests/test_serviceregistration.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/services/tests/test_serviceregistration.py:1.3	Thu Dec 18 04:57:15 2003
+++ Zope3/src/zope/app/services/tests/test_serviceregistration.py	Sat Mar  6 11:50:30 2004
@@ -22,7 +22,7 @@
 
 from zope.interface import Interface, implements
 
-from zope.component import getServiceManager, getAdapter
+from zope.component import getServiceManager
 from zope.app.traversing import traverse, getPath
 from zope.app.services.service import ServiceRegistration
 from zope.app.services.tests.placefulsetup import PlacefulSetup
@@ -117,7 +117,7 @@
     def test_addNotify(self):
         self.assertEqual(self.__c._dependents,
                          (self.__configpath, ))
-        u = getAdapter(self.__c, IRegistered)
+        u = IRegistered(self.__c)
         self.assertEqual(list(u.usages()),
                          [self.__configpath])
 
@@ -130,7 +130,7 @@
 
         del self.__cm[self.__registration_name]
         self.assertEqual(self.__c._dependents, ())
-        u = getAdapter(self.__c, IRegistered)
+        u = IRegistered(self.__c)
         self.assertEqual(len(u.usages()), 0)
 
         self.failIf(registry, "The components should not be registered")




More information about the Zope3-Checkins mailing list