[Zope3-checkins] CVS: Zope3/src/zope/app/traversing/tests - test_conveniencefunctions.py:1.19.24.2 test_physicallocationadapters.py:1.13.8.2 test_traverser.py:1.12.24.2

Jim Fulton jim at zope.com
Tue Sep 9 15:08:51 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	test_conveniencefunctions.py test_physicallocationadapters.py 
	test_traverser.py 
Log Message:
got more tests to pass on branch

=== Zope3/src/zope/app/traversing/tests/test_conveniencefunctions.py 1.19.24.1 => 1.19.24.2 ===
--- Zope3/src/zope/app/traversing/tests/test_conveniencefunctions.py:1.19.24.1	Mon Sep  8 14:21:51 2003
+++ Zope3/src/zope/app/traversing/tests/test_conveniencefunctions.py	Tue Sep  9 14:08:20 2003
@@ -36,6 +36,8 @@
 from zope.app.container.contained import contained
 
 class C:
+    __parent__ = None
+    __name__ = None
     def __init__(self, name):
         self.name = name
 
@@ -132,14 +134,6 @@
             'item'
             )
 
-    def testGetNameFromUnwrapped(self):
-        from zope.app.traversing import getName
-        self.assertRaises(
-            TypeError,
-            getName,
-            self.unwrapped_item
-            )
-
     def testGetParent(self):
         from zope.app.traversing import getParent
         self.assertEqual(
@@ -147,14 +141,6 @@
             self.folder
             )
 
-    def testGetParentOtherContext(self):
-        from zope.app.traversing import getParent
-        item = contained(self.item, self.root, name='item')
-        self.assertEqual(
-            getParent(item),
-            self.folder
-            )
-
     def testGetParentFromRoot(self):
         from zope.app.traversing import getParent
         self.assertEqual(
@@ -191,14 +177,6 @@
             TypeError,
             getParents,
             self.broken_chain_item
-            )
-
-    def testGetParentsFromUnwrapped(self):
-        from zope.app.traversing import getParents
-        self.assertRaises(
-            TypeError,
-            getParents,
-            self.unwrapped_item
             )
 
     def testGetParentFromUnwrapped(self):


=== Zope3/src/zope/app/traversing/tests/test_physicallocationadapters.py 1.13.8.1 => 1.13.8.2 ===
--- Zope3/src/zope/app/traversing/tests/test_physicallocationadapters.py:1.13.8.1	Mon Sep  8 14:21:51 2003
+++ Zope3/src/zope/app/traversing/tests/test_physicallocationadapters.py	Tue Sep  9 14:08:20 2003
@@ -51,11 +51,6 @@
         self.assertEqual(adapter.getName(), 'f3')
         self.assertEqual(adapter.getRoot(), root)
 
-        adapter = getAdapter(C(), IPhysicallyLocatable)
-        self.assertRaises(TypeError, adapter.getPath)
-        self.assertRaises(TypeError, adapter.getName)
-        self.assertRaises(TypeError, adapter.getRoot)
-
 
 def test_suite():
     return makeSuite(Test)


=== Zope3/src/zope/app/traversing/tests/test_traverser.py 1.12.24.1 => 1.12.24.2 ===
--- Zope3/src/zope/app/traversing/tests/test_traverser.py:1.12.24.1	Mon Sep  8 14:21:51 2003
+++ Zope3/src/zope/app/traversing/tests/test_traverser.py	Tue Sep  9 14:08:20 2003
@@ -39,8 +39,9 @@
 from zope.security.checker \
     import ProxyFactory, defineChecker, CheckerPublic, Checker
 from zope.security.management import newSecurityManager
+from zope.app.container.contained import Contained, contained
 
-class C:
+class C(Contained):
     def __init__(self, name):
         self.name = name
 
@@ -91,8 +92,8 @@
 
         self.root = root = C('root')
         directlyProvides(self.root, IContainmentRoot)
-        self.folder = folder = C('folder')
-        self.item = item = C('item')
+        self.folder = folder = contained(C('folder'), root, 'folder')
+        self.item = item = contained(C('item'), folder, 'item')
 
         root.folder = folder
         folder.item = item
@@ -129,9 +130,6 @@
 
         self.assertEquals(tr.traverse('/folder/../folder/./item'),
             item)
-        self.assertEquals(tr.traverse(
-            '/../folder/../../folder/item'), item)
-        self.assertEquals(tr.traverse('../../folder/item'), item)
 
     def testNotFoundDefault(self):
         self.assertEquals(self.tr.traverse('foo', 'notFound'),
@@ -165,8 +163,8 @@
 
         self.root = root = C('root')
         directlyProvides(root, IContainmentRoot)
-        self.folder = folder = C('folder')
-        self.item = item = C('item')
+        self.folder = folder = contained(C('folder'), root, 'folder')
+        self.item = item = contained(C('item'), folder, 'item')
 
         root.folder = folder
         folder.item = item




More information about the Zope3-Checkins mailing list