[Zope3-checkins] CVS: Zope3/src/zope/app/traversing/tests -
test_acquire.py:1.7.26.1 test_conveniencefunctions.py:1.19.24.1
test_physicallocationadapters.py:1.13.8.1
test_traverser.py:1.12.24.1
Jim Fulton
jim at zope.com
Mon Sep 8 15:22:24 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/traversing/tests
In directory cvs.zope.org:/tmp/cvs-serv20092/src/zope/app/traversing/tests
Modified Files:
Tag: parentgeddon-branch
test_acquire.py test_conveniencefunctions.py
test_physicallocationadapters.py test_traverser.py
Log Message:
Checking in work in progress on parentgeddon-branch so Fred can help
me to get the tests passing. Specific log entries will be provided
when we merge this into the head.
=== Zope3/src/zope/app/traversing/tests/test_acquire.py 1.7 => 1.7.26.1 ===
--- Zope3/src/zope/app/traversing/tests/test_acquire.py:1.7 Sun Jun 1 11:59:38 2003
+++ Zope3/src/zope/app/traversing/tests/test_acquire.py Mon Sep 8 14:21:51 2003
@@ -22,7 +22,6 @@
from zope.app.interfaces.traversing import ITraversable
from zope.app.traversing.adapters import DefaultTraversable
from zope.component.adapter import provideAdapter
-from zope.app.context import ContextWrapper
from zope.app.traversing.namespace import acquire
from zope.exceptions import NotFoundError
@@ -37,13 +36,13 @@
a = C('a')
a.a1 = C('a1')
- a.a2 = C('a2')
- a.a2.a21 = C('a21')
- a.a2.a21.a211 = C('a211')
+ a.a2 = C('a2'); a.a2.__parent__ = a
+ a.a2.a21 = C('a21'); a.a2.a21.__parent__ = a.a2
+ a.a2.a21.a211 = C('a211'); a.a2.a21.a211.__parent__ = a.a2.a21
- a2 = ContextWrapper(a.a2, a)
- a21 = ContextWrapper(a.a2.a21, a2)
- a211 = ContextWrapper(a.a2.a21.a211, a21)
+ a2 = a.a2
+ a21 = a.a2.a21
+ a211 = a.a2.a21.a211
acquired = acquire('a1', (), 'a1;acquire', a211, None)
=== Zope3/src/zope/app/traversing/tests/test_conveniencefunctions.py 1.19 => 1.19.24.1 ===
--- Zope3/src/zope/app/traversing/tests/test_conveniencefunctions.py:1.19 Fri Jun 13 13:41:21 2003
+++ Zope3/src/zope/app/traversing/tests/test_conveniencefunctions.py Mon Sep 8 14:21:51 2003
@@ -18,8 +18,6 @@
from unittest import TestCase, main, makeSuite
from zope.interface import directlyProvides
from zope.app.services.tests.placefulsetup import PlacefulSetup
-from zope.app.context import ContextWrapper
-from zope.context import isWrapper
from zope.app.traversing.adapters import Traverser
from zope.component import getService
from zope.app.services.servicenames import Adapters
@@ -28,13 +26,14 @@
from zope.app.interfaces.traversing import IPhysicallyLocatable
from zope.app.interfaces.traversing import IContainmentRoot
-from zope.app.traversing.adapters import WrapperPhysicallyLocatable
+from zope.app.location import LocationPhysicallyLocatable
from zope.app.traversing.adapters import RootPhysicallyLocatable
from zope.security.proxy import Proxy
from zope.security.checker import selectChecker
from zope.exceptions import NotFoundError
+from zope.app.container.contained import contained
class C:
def __init__(self, name):
@@ -55,11 +54,11 @@
item = C('item')
self.root = root # root is not usually wrapped
- self.folder = ContextWrapper(folder, self.root, name='folder')
- self.item = ContextWrapper(item, self.folder, name='item')
+ self.folder = contained(folder, self.root, name='folder')
+ self.item = contained(item, self.folder, name='item')
self.unwrapped_item = item
- self.broken_chain_folder = ContextWrapper(folder, None)
- self.broken_chain_item = ContextWrapper(item,
+ self.broken_chain_folder = contained(folder, None)
+ self.broken_chain_item = contained(item,
self.broken_chain_folder,
name='item'
)
@@ -72,7 +71,7 @@
getService(None, Adapters).provideAdapter(
None, ITraversable, DefaultTraversable)
getService(None, Adapters).provideAdapter(
- None, IPhysicallyLocatable, WrapperPhysicallyLocatable)
+ None, IPhysicallyLocatable, LocationPhysicallyLocatable)
getService(None, Adapters).provideAdapter(
IContainmentRoot, IPhysicallyLocatable, RootPhysicallyLocatable)
@@ -105,7 +104,7 @@
traverseName(self.item, '..'),
self.tr.traverse('/folder')
)
- self.assert_(isWrapper(traverseName(self.folder, 'item')))
+
# XXX test that ++names++ and @@names work too
def testTraverseNameBadValue(self):
@@ -150,7 +149,7 @@
def testGetParentOtherContext(self):
from zope.app.traversing import getParent
- item = ContextWrapper(self.item, self.root, name='item')
+ item = contained(self.item, self.root, name='item')
self.assertEqual(
getParent(item),
self.folder
=== Zope3/src/zope/app/traversing/tests/test_physicallocationadapters.py 1.13 => 1.13.8.1 ===
--- Zope3/src/zope/app/traversing/tests/test_physicallocationadapters.py:1.13 Fri Aug 8 14:07:11 2003
+++ Zope3/src/zope/app/traversing/tests/test_physicallocationadapters.py Mon Sep 8 14:21:51 2003
@@ -23,9 +23,9 @@
from zope.app.interfaces.traversing import IContainmentRoot
from zope.app.interfaces.traversing import IPhysicallyLocatable
-from zope.app.traversing.adapters import WrapperPhysicallyLocatable
+from zope.app.location import LocationPhysicallyLocatable
from zope.app.traversing.adapters import RootPhysicallyLocatable
-from zope.app.context import ContextWrapper
+from zope.app.container.contained import contained
class Root:
implements(IContainmentRoot)
@@ -36,14 +36,14 @@
class Test(PlacelessSetup, TestCase):
def test(self):
- provideAdapter(None, IPhysicallyLocatable, WrapperPhysicallyLocatable)
+ provideAdapter(None, IPhysicallyLocatable, LocationPhysicallyLocatable)
provideAdapter(IContainmentRoot, IPhysicallyLocatable,
RootPhysicallyLocatable)
root = Root()
- f1 = ContextWrapper(C(), root, name='f1')
- f2 = ContextWrapper(C(), f1, name='f2')
- f3 = ContextWrapper(C(), f2, name='f3')
+ f1 = contained(C(), root, name='f1')
+ f2 = contained(C(), f1, name='f2')
+ f3 = contained(C(), f2, name='f3')
adapter = getAdapter(f3, IPhysicallyLocatable)
=== Zope3/src/zope/app/traversing/tests/test_traverser.py 1.12 => 1.12.24.1 ===
--- Zope3/src/zope/app/traversing/tests/test_traverser.py:1.12 Sat Jun 7 02:54:24 2003
+++ Zope3/src/zope/app/traversing/tests/test_traverser.py Mon Sep 8 14:21:51 2003
@@ -27,10 +27,10 @@
from zope.app.interfaces.traversing import IPhysicallyLocatable
from zope.app.interfaces.traversing import IContainmentRoot
-from zope.app.traversing.adapters import WrapperPhysicallyLocatable
+from zope.app.location import LocationPhysicallyLocatable
from zope.app.traversing.adapters import RootPhysicallyLocatable
+from zope.app.container.contained import contained
-from zope.app.context import ContextWrapper
from zope.exceptions import NotFoundError, Unauthorized
from zope.component import getService
from zope.app.services.servicenames import Adapters
@@ -50,8 +50,8 @@
PlacefulSetup.setUp(self)
# Build up a wrapper chain
self.root = C('root')
- self.folder = ContextWrapper(C('folder'), self.root, name='folder')
- self.item = ContextWrapper(C('item'), self.folder, name='item')
+ self.folder = contained(C('folder'), self.root, name='folder')
+ self.item = contained(C('item'), self.folder, name='item')
self.tr = Traverser(self.item)
def testImplementsITraverser(self):
@@ -85,7 +85,7 @@
getService(None, Adapters).provideAdapter(
None, ITraversable, DefaultTraversable)
getService(None, Adapters).provideAdapter(
- None, IPhysicallyLocatable, WrapperPhysicallyLocatable)
+ None, IPhysicallyLocatable, LocationPhysicallyLocatable)
getService(None, Adapters).provideAdapter(
IContainmentRoot, IPhysicallyLocatable, RootPhysicallyLocatable)
@@ -159,7 +159,7 @@
getService(None,Adapters).provideAdapter(
None, ITraversable, DefaultTraversable)
getService(None, Adapters).provideAdapter(
- None, IPhysicallyLocatable, WrapperPhysicallyLocatable)
+ None, IPhysicallyLocatable, LocationPhysicallyLocatable)
getService(None, Adapters).provideAdapter(
IContainmentRoot, IPhysicallyLocatable, RootPhysicallyLocatable)
More information about the Zope3-Checkins
mailing list