[Zope3-checkins] CVS: Zope3/src/zope/app/tests -
placelesssetup.py:1.8 setup.py:1.8 test_clipboard.py:1.7
test_rename.py:1.3
Jim Fulton
cvs-admin at zope.org
Fri Nov 21 12:12:45 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/tests
In directory cvs.zope.org:/tmp/cvs-serv31883/src/zope/app/tests
Modified Files:
placelesssetup.py setup.py test_clipboard.py test_rename.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/tests/placelesssetup.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/tests/placelesssetup.py:1.7 Sun Sep 21 13:33:29 2003
+++ Zope3/src/zope/app/tests/placelesssetup.py Fri Nov 21 12:12:14 2003
@@ -17,6 +17,7 @@
$Id$
"""
+from zope.app.tests import ztapi
from zope.component.tests.placelesssetup \
import PlacelessSetup as CAPlacelessSetup
from zope.app.component.tests.placelesssetup \
@@ -28,8 +29,6 @@
from zope.app.container.tests.placelesssetup \
import PlacelessSetup as ContainerPlaclessSetup
from zope.app.security._protections import protect
-from zope.component.view import provideView
-from zope.publisher.browser import IBrowserPresentation
from zope.app.browser.absoluteurl import AbsoluteURL
class PlacelessSetup(CAPlacelessSetup,
@@ -48,7 +47,7 @@
# Register app-specific security declarations
protect()
- provideView(None, 'absolute_url', IBrowserPresentation, AbsoluteURL)
+ ztapi.browserView(None, 'absolute_url', AbsoluteURL)
ps = PlacelessSetup()
=== Zope3/src/zope/app/tests/setup.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/tests/setup.py:1.7 Sun Sep 21 13:33:30 2003
+++ Zope3/src/zope/app/tests/setup.py Fri Nov 21 12:12:14 2003
@@ -18,8 +18,7 @@
import zope.component
from zope.app import zapi
-from zope.component.adapter import provideAdapter
-from zope.component.view import provideView
+from zope.app.tests import ztapi
from zope.interface import classImplements
#------------------------------------------------------------------------
@@ -28,16 +27,16 @@
from zope.app.interfaces.annotation import IAnnotations
from zope.app.interfaces.annotation import IAttributeAnnotatable
def setUpAnnotations():
- provideAdapter(IAttributeAnnotatable, IAnnotations,
- AttributeAnnotations)
+ ztapi.provideAdapter(IAttributeAnnotatable, IAnnotations,
+ AttributeAnnotations)
#------------------------------------------------------------------------
# Dependencies
from zope.app.dependable import Dependable
from zope.app.interfaces.dependable import IDependable
def setUpDependable():
- provideAdapter(IAttributeAnnotatable, IDependable,
- Dependable)
+ ztapi.provideAdapter(IAttributeAnnotatable, IDependable,
+ Dependable)
#------------------------------------------------------------------------
# Traversal
@@ -51,25 +50,23 @@
from zope.app.traversing.adapters import Traverser, RootPhysicallyLocatable
from zope.app.location import LocationPhysicallyLocatable
from zope.app.traversing.namespace import etc, provideNamespaceHandler
-from zope.publisher.interfaces.browser import IBrowserPresentation
+
def setUpTraversal():
- provideAdapter(None, ITraverser, Traverser)
- provideAdapter(None, ITraversable, DefaultTraversable)
+ ztapi.provideAdapter(None, ITraverser, Traverser)
+ ztapi.provideAdapter(None, ITraversable, DefaultTraversable)
- provideAdapter(
+ ztapi.provideAdapter(
ISimpleReadContainer, ITraversable, ContainerTraversable)
- provideAdapter(
+ ztapi.provideAdapter(
None, IPhysicallyLocatable, LocationPhysicallyLocatable)
- provideAdapter(
+ ztapi.provideAdapter(
IContainmentRoot, IPhysicallyLocatable, RootPhysicallyLocatable)
# set up etc namespace
provideNamespaceHandler("etc", etc)
- provideView(None, "absolute_url", IBrowserPresentation,
- AbsoluteURL)
- provideView(IContainmentRoot, "absolute_url", IBrowserPresentation,
- SiteAbsoluteURL)
+ ztapi.browserView(None, "absolute_url", AbsoluteURL)
+ ztapi.browserView(IContainmentRoot, "absolute_url", SiteAbsoluteURL)
#------------------------------------------------------------------------
# Use registration
@@ -77,8 +74,8 @@
from zope.app.interfaces.services.registration import IRegistered
from zope.app.services.registration import Registered
def setUpRegistered():
- provideAdapter(IAttributeRegisterable, IRegistered,
- Registered)
+ ztapi.provideAdapter(IAttributeRegisterable, IRegistered,
+ Registered)
#------------------------------------------------------------------------
=== Zope3/src/zope/app/tests/test_clipboard.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/tests/test_clipboard.py:1.6 Thu May 29 14:15:56 2003
+++ Zope3/src/zope/app/tests/test_clipboard.py Fri Nov 21 12:12:14 2003
@@ -20,7 +20,7 @@
from zope.app.interfaces.copypastemove import IPrincipalClipboard
from zope.app.copypastemove import PrincipalClipboard
from zope.component import getAdapter, getService, getServiceManager
-from zope.component.adapter import provideAdapter
+from zope.app.tests import ztapi
from zope.app.services.principalannotation \
import PrincipalAnnotationService
from zope.app.interfaces.services.principalannotation \
@@ -35,7 +35,8 @@
PlacefulSetup.setUp(self)
self.buildFolders()
- provideAdapter(IAnnotations, IPrincipalClipboard, PrincipalClipboard)
+ ztapi.provideAdapter(IAnnotations, IPrincipalClipboard,
+ PrincipalClipboard)
root_sm = getServiceManager(None)
svc = PrincipalAnnotationService()
root_sm.defineService("PrincipalAnnotation", \
=== Zope3/src/zope/app/tests/test_rename.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/tests/test_rename.py:1.2 Sun Sep 21 13:33:38 2003
+++ Zope3/src/zope/app/tests/test_rename.py Fri Nov 21 12:12:14 2003
@@ -21,7 +21,7 @@
from zope.app.traversing import traverse
from zope.app.services.tests.placefulsetup import PlacefulSetup
from zope.component import getAdapter
-from zope.component.adapter import provideAdapter
+from zope.app.tests import ztapi
from zope.app.interfaces.copypastemove import IObjectMover
from zope.app.interfaces.container import IContainer
from zope.app.copypastemove import ObjectMover
@@ -34,7 +34,7 @@
def setUp(self):
PlacefulSetup.setUp(self)
PlacefulSetup.buildFolders(self)
- provideAdapter(None, IObjectMover, ObjectMover)
+ ztapi.provideAdapter(None, IObjectMover, ObjectMover)
def test_simplerename(self):
root = self.rootFolder
More information about the Zope3-Checkins
mailing list