[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_objecthub.py:1.8

Marius Gedminas mgedmin@codeworks.lt
Mon, 24 Mar 2003 11:42:52 -0500


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

Modified Files:
	test_objecthub.py 
Log Message:
zope.app.traversing changes:
- canonicalPath() now actually makes the path canonical
- locationAsTuple() is gone
- traverse() now gets an adapter to ITraverser instead of hardcoding Traverser
- traverseName() now accepts a 'traversable' argument opening the way for
  optimizations
- some tests had to be updated

SteveA & Marius



=== Zope3/src/zope/app/services/tests/test_objecthub.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/tests/test_objecthub.py:1.7	Fri Mar 21 10:29:09 2003
+++ Zope3/src/zope/app/services/tests/test_objecthub.py	Mon Mar 24 11:42:21 2003
@@ -208,12 +208,14 @@
             return FakeObject(canonicalPath(location))
 
         from zope.app.interfaces.traversing import ITraverser
-        class DummyTraverser:
+        from zope.app.traversing.adapters import Traverser
+        class DummyTraverser(Traverser):
             __implements__ = ITraverser
-            def __init__(self, context):
-                pass
-            def traverse(self, location):
-                return fake_object_for_location(location)
+            def traverse(self, location, *args, **kw):
+                if location in TestSearchRegistrations.locations:
+                    return fake_object_for_location(location)
+                else:
+                    return Traverser.traverse(self, location, *args, **kw)
 
         from zope.component.adapter import provideAdapter
         provideAdapter(None, ITraverser, DummyTraverser)