[Zope3-checkins]
SVN: Zope3/branches/jim-adapter/src/zope/traversing/tests/test_
Make ztapi extinct in zope.traversing
Philipp von Weitershausen
philikon at philikon.de
Wed Apr 5 11:01:07 EDT 2006
Log message for revision 66547:
Make ztapi extinct in zope.traversing
Changed:
U Zope3/branches/jim-adapter/src/zope/traversing/tests/test_conveniencefunctions.py
U Zope3/branches/jim-adapter/src/zope/traversing/tests/test_lang.py
U Zope3/branches/jim-adapter/src/zope/traversing/tests/test_physicallocationadapters.py
U Zope3/branches/jim-adapter/src/zope/traversing/tests/test_traverser.py
-=-
Modified: Zope3/branches/jim-adapter/src/zope/traversing/tests/test_conveniencefunctions.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/tests/test_conveniencefunctions.py 2006-04-05 14:53:20 UTC (rev 66546)
+++ Zope3/branches/jim-adapter/src/zope/traversing/tests/test_conveniencefunctions.py 2006-04-05 15:01:06 UTC (rev 66547)
@@ -16,6 +16,8 @@
$Id$
"""
from unittest import TestCase, main, makeSuite
+
+import zope.component
from zope.interface import directlyProvides
from zope.location.traversing import LocationPhysicallyLocatable
from zope.security.proxy import Proxy
@@ -26,7 +28,6 @@
from zope.traversing.interfaces import IContainmentRoot, TraversalError
from zope.traversing.interfaces import IPhysicallyLocatable
-from zope.app.testing import ztapi
from zope.app.component.testing import PlacefulSetup
from zope.app.container.contained import contained
@@ -63,14 +64,12 @@
folder.item = item
self.tr = Traverser(root)
- ztapi.provideAdapter(
- None, ITraverser, Traverser)
- ztapi.provideAdapter(
- None, ITraversable, DefaultTraversable)
- ztapi.provideAdapter(
- None, IPhysicallyLocatable, LocationPhysicallyLocatable)
- ztapi.provideAdapter(
- IContainmentRoot, IPhysicallyLocatable, RootPhysicallyLocatable)
+ zope.component.provideAdapter(Traverser, (None,), ITraverser)
+ zope.component.provideAdapter(DefaultTraversable, (None,), ITraversable)
+ zope.component.provideAdapter(LocationPhysicallyLocatable, (None,),
+ IPhysicallyLocatable)
+ zope.component.provideAdapter(RootPhysicallyLocatable,
+ (IContainmentRoot,), IPhysicallyLocatable)
def testTraverse(self):
from zope.traversing.api import traverse
Modified: Zope3/branches/jim-adapter/src/zope/traversing/tests/test_lang.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/tests/test_lang.py 2006-04-05 14:53:20 UTC (rev 66546)
+++ Zope3/branches/jim-adapter/src/zope/traversing/tests/test_lang.py 2006-04-05 15:01:06 UTC (rev 66547)
@@ -17,13 +17,13 @@
"""
import unittest
+import zope.component
from zope.interface import directlyProvides
from zope.publisher.interfaces.http import IHTTPRequest
from zope.publisher.tests import test_browserlanguages
from zope.i18n.interfaces import IModifiableUserPreferredLanguages
from zope.traversing.namespace import lang
-from zope.app.testing import ztapi
from zope.app.annotation import IAttributeAnnotatable, IAnnotations
from zope.app.annotation.attribute import AttributeAnnotations
from zope.app.publisher.browser import ModifiableBrowserLanguages
@@ -38,10 +38,11 @@
def setUp(self):
self.request = TestRequest("en")
directlyProvides(self.request, IHTTPRequest, IAttributeAnnotatable)
- ztapi.provideAdapter(IAttributeAnnotatable, IAnnotations,
- AttributeAnnotations)
- ztapi.provideAdapter(IHTTPRequest,
- IModifiableUserPreferredLanguages, ModifiableBrowserLanguages)
+ zope.component.provideAdapter(AttributeAnnotations,
+ (IAttributeAnnotatable,), IAnnotations)
+ zope.component.provideAdapter(ModifiableBrowserLanguages,
+ (IHTTPRequest,),
+ IModifiableUserPreferredLanguages)
def test_adapter(self):
request = self.request
Modified: Zope3/branches/jim-adapter/src/zope/traversing/tests/test_physicallocationadapters.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/tests/test_physicallocationadapters.py 2006-04-05 14:53:20 UTC (rev 66546)
+++ Zope3/branches/jim-adapter/src/zope/traversing/tests/test_physicallocationadapters.py 2006-04-05 15:01:06 UTC (rev 66547)
@@ -20,7 +20,7 @@
from zope.traversing.interfaces import IContainmentRoot
from zope.traversing.interfaces import IPhysicallyLocatable
-from zope.app.testing import ztapi, setup
+from zope.app.testing import setup
from zope.app.container.contained import contained
from zope.app.component.site import SiteManagerContainer
Modified: Zope3/branches/jim-adapter/src/zope/traversing/tests/test_traverser.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/tests/test_traverser.py 2006-04-05 14:53:20 UTC (rev 66546)
+++ Zope3/branches/jim-adapter/src/zope/traversing/tests/test_traverser.py 2006-04-05 15:01:06 UTC (rev 66547)
@@ -17,9 +17,14 @@
"""
import unittest
+import zope.component
from zope.interface import directlyProvides, implementedBy
from zope.interface.verify import verifyClass
from zope.location.traversing import LocationPhysicallyLocatable
+from zope.security.interfaces import Unauthorized
+from zope.security.checker \
+ import ProxyFactory, defineChecker, CheckerPublic, Checker
+from zope.security.management import newInteraction, endInteraction
from zope.traversing.adapters import Traverser, DefaultTraversable
from zope.traversing.adapters import RootPhysicallyLocatable
@@ -27,12 +32,6 @@
from zope.traversing.interfaces import IPhysicallyLocatable
from zope.traversing.interfaces import IContainmentRoot, TraversalError
-from zope.security.interfaces import Unauthorized
-from zope.security.checker \
- import ProxyFactory, defineChecker, CheckerPublic, Checker
-from zope.security.management import newInteraction, endInteraction
-
-from zope.app.testing import ztapi
from zope.app.component.testing import PlacefulSetup
from zope.app.container.contained import Contained, contained
@@ -82,15 +81,14 @@
class UnrestrictedTraverseTests(PlacefulSetup, unittest.TestCase):
def setUp(self):
PlacefulSetup.setUp(self)
- # Build up a wrapper chain
- ztapi.provideAdapter(
- None, ITraversable, DefaultTraversable)
- ztapi.provideAdapter(
- None, IPhysicallyLocatable, LocationPhysicallyLocatable)
- ztapi.provideAdapter(
- IContainmentRoot, IPhysicallyLocatable, RootPhysicallyLocatable)
+ zope.component.provideAdapter(DefaultTraversable, (None,), ITraversable)
+ zope.component.provideAdapter(LocationPhysicallyLocatable, (None,),
+ IPhysicallyLocatable)
+ zope.component.provideAdapter(RootPhysicallyLocatable,
+ (IContainmentRoot,), IPhysicallyLocatable)
+ # Build up a wrapper chain
self.root = root = C('root')
directlyProvides(self.root, IContainmentRoot)
self.folder = folder = contained(C('folder'), root, 'folder')
@@ -146,12 +144,11 @@
def setUp(self):
PlacefulSetup.setUp(self)
- ztapi.provideAdapter(
- None, ITraversable, DefaultTraversable)
- ztapi.provideAdapter(
- None, IPhysicallyLocatable, LocationPhysicallyLocatable)
- ztapi.provideAdapter(
- IContainmentRoot, IPhysicallyLocatable, RootPhysicallyLocatable)
+ zope.component.provideAdapter(DefaultTraversable, (None,), ITraversable)
+ zope.component.provideAdapter(LocationPhysicallyLocatable, (None,),
+ IPhysicallyLocatable)
+ zope.component.provideAdapter(RootPhysicallyLocatable,
+ (IContainmentRoot,), IPhysicallyLocatable)
self.root = root = C('root')
directlyProvides(root, IContainmentRoot)
More information about the Zope3-Checkins
mailing list