[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_auth.py:1.20 test_eventservice.py:1.29 test_objecthub.py:1.15 test_principalannotation.py:1.9

Jim Fulton cvs-admin at zope.org
Fri Nov 21 12:12:45 EST 2003


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

Modified Files:
	test_auth.py test_eventservice.py test_objecthub.py 
	test_principalannotation.py 
Log Message:
Changed to use the new ztapi module, which provides handy functions
for setting up adapters and views for tests.  This is needed because
there are no-longer global adapter and view services sitting around as
module globals.


=== Zope3/src/zope/app/services/tests/test_auth.py 1.19 => 1.20 ===
--- Zope3/src/zope/app/services/tests/test_auth.py:1.19	Sun Sep 21 13:30:46 2003
+++ Zope3/src/zope/app/services/tests/test_auth.py	Fri Nov 21 12:12:13 2003
@@ -28,6 +28,7 @@
 from zope.app.container.tests.test_icontainer import BaseTestIContainer
 from zope.interface import implements
 from zope.app.tests import setup
+from zope.app.tests import ztapi
 
 class Request:
 
@@ -52,7 +53,7 @@
         from zope.component import getService
         from zope.app.security.basicauthadapter import BasicAuthAdapter
         from zope.app.interfaces.security import ILoginPassword
-        getService(None, Adapters).provideAdapter(
+        ztapi.provideAdapter(
             IHTTPCredentials, ILoginPassword, BasicAuthAdapter)
 
         sm = traverse(self.rootFolder, '++etc++site')


=== Zope3/src/zope/app/services/tests/test_eventservice.py 1.28 => 1.29 ===
--- Zope3/src/zope/app/services/tests/test_eventservice.py:1.28	Sun Sep 21 13:33:15 2003
+++ Zope3/src/zope/app/services/tests/test_eventservice.py	Fri Nov 21 12:12:13 2003
@@ -37,7 +37,7 @@
 from zope.app.interfaces.services.registration import RegisteredStatus
 from zope.app.services.tests.eventsetup import EventSetup
 from zope.component.tests.components import RecordingAdapter
-from zope.component.adapter import provideAdapter
+from zope.app.tests import ztapi
 from zope.app.interfaces.services.service import ISimpleService
 from zope.app.services.event import EventService
 from zope.app.tests import setup
@@ -922,9 +922,9 @@
 
     def testSubscriptionAwareInteraction(self):
         adapter = SubscribingAwareAdapter()
-        provideAdapter(IHasSubscribingAwareAdapter,
-                       ISubscribingAware,
-                       adapter)
+        ztapi.provideAdapter(IHasSubscribingAwareAdapter,
+                             ISubscribingAware,
+                             adapter)
         self.rootFolder["mySubscriber"] = HasSubscribingAwareAdapter()
         self.mySubscriber = self.rootFolder["mySubscriber"]
         filter = DummyFilter()


=== Zope3/src/zope/app/services/tests/test_objecthub.py 1.14 => 1.15 ===
--- Zope3/src/zope/app/services/tests/test_objecthub.py:1.14	Fri Oct 31 18:09:16 2003
+++ Zope3/src/zope/app/services/tests/test_objecthub.py	Fri Nov 21 12:12:13 2003
@@ -18,6 +18,7 @@
 """
 
 import unittest
+from zope.app.tests import ztapi
 from zope.app import zapi
 from zope.app.services.tests.objecthubsetup import ObjectHubSetup
 
@@ -235,8 +236,7 @@
                 else:
                     return Traverser.traverse(self, location, *args, **kw)
 
-        from zope.component.adapter import provideAdapter
-        provideAdapter(None, ITraverser, DummyTraverser)
+        ztapi.provideAdapter(None, ITraverser, DummyTraverser)
 
         object_hub = self.object_hub
         location_hubid_object = [(location,


=== Zope3/src/zope/app/services/tests/test_principalannotation.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/services/tests/test_principalannotation.py:1.8	Sat Jun  7 01:32:01 2003
+++ Zope3/src/zope/app/services/tests/test_principalannotation.py	Fri Nov 21 12:12:13 2003
@@ -24,7 +24,7 @@
      PrincipalAnnotationService, AnnotationsForPrincipal
 from zope.app.interfaces.services.principalannotation import \
      IPrincipalAnnotationService
-from zope.component.adapter import provideAdapter
+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
@@ -100,8 +100,8 @@
 
     def testAdapter(self):
         p = Principal('somebody')
-        provideAdapter(IPrincipal, IAnnotations,
-                       AnnotationsForPrincipal(self.svc))
+        ztapi.provideAdapter(IPrincipal, IAnnotations,
+                             AnnotationsForPrincipal(self.svc))
         annotations = getAdapter(p, IAnnotations)
         annotations["test"] = "bar"
         annotations = getAdapter(p, IAnnotations)




More information about the Zope3-Checkins mailing list