[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/traversing/ Move test fixtures to zope.traversing.testing. More stuff will be placed there.

Philipp von Weitershausen philikon at philikon.de
Wed Apr 5 11:05:59 EDT 2006


Log message for revision 66548:
  Move test fixtures to zope.traversing.testing. More stuff will be placed there.
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/traversing/browser/tests.py
  U   Zope3/branches/jim-adapter/src/zope/traversing/namespace.py
  A   Zope3/branches/jim-adapter/src/zope/traversing/testing.py
  U   Zope3/branches/jim-adapter/src/zope/traversing/tests/test_presentation.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/traversing/browser/tests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/browser/tests.py	2006-04-05 15:01:06 UTC (rev 66547)
+++ Zope3/branches/jim-adapter/src/zope/traversing/browser/tests.py	2006-04-05 15:05:59 UTC (rev 66548)
@@ -21,12 +21,12 @@
 from zope.component import getMultiAdapter
 from zope.traversing.browser.absoluteurl import absoluteURL
 from zope.traversing.browser.interfaces import IAbsoluteURL
+from zope.traversing.testing import browserView, browserResource
 from zope.i18n.interfaces import IUserPreferredCharsets
 from zope.interface import Interface, implements
 from zope.interface.verify import verifyObject
 from zope.publisher.browser import TestRequest
 from zope.publisher.http import IHTTPRequest, HTTPCharsets
-from zope.publisher.interfaces.browser import IDefaultBrowserLayer
 
 from zope.app.container.contained import contained
 
@@ -39,14 +39,6 @@
 class TrivialContent(object):
     """Trivial content object, used because instances of object are rocks."""
 
-def browserView(for_, name, factory, providing=Interface):
-    zope.component.provideAdapter(factory, (for_, IDefaultBrowserLayer),
-                                  providing, name=name)
-
-def browserResource(name, factory, providing=Interface):
-    zope.component.provideAdapter(factory, (IDefaultBrowserLayer,),
-                                  providing, name=name)
-
 class TestAbsoluteURL(TestCase):
 
     def setUp(self):

Modified: Zope3/branches/jim-adapter/src/zope/traversing/namespace.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/namespace.py	2006-04-05 15:01:06 UTC (rev 66547)
+++ Zope3/branches/jim-adapter/src/zope/traversing/namespace.py	2006-04-05 15:05:59 UTC (rev 66548)
@@ -87,7 +87,7 @@
          ...         pass
          ...     def traverse(self, name, remaining):
          ...         return name+'fromview'
-         >>> from zope.traversing.browser.tests import browserView
+         >>> from zope.traversing.testing import browserView
          >>> browserView(I, 'foo', View, providing=ITraversable)
 
          >>> namespaceLookup('foo', 'bar', C(), request)

Added: Zope3/branches/jim-adapter/src/zope/traversing/testing.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/testing.py	2006-04-05 15:01:06 UTC (rev 66547)
+++ Zope3/branches/jim-adapter/src/zope/traversing/testing.py	2006-04-05 15:05:59 UTC (rev 66548)
@@ -0,0 +1,30 @@
+##############################################################################
+#
+# Copyright (c) 2005 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Traversing test fixtures
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+import zope.component
+import zope.interface
+from zope.publisher.interfaces.browser import IDefaultBrowserLayer
+
+def browserView(for_, name, factory, providing=zope.interface.Interface):
+    zope.component.provideAdapter(factory, (for_, IDefaultBrowserLayer),
+                                  providing, name=name)
+
+def browserResource(name, factory, providing=zope.interface.Interface):
+    zope.component.provideAdapter(factory, (IDefaultBrowserLayer,),
+                                  providing, name=name)


Property changes on: Zope3/branches/jim-adapter/src/zope/traversing/testing.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: Zope3/branches/jim-adapter/src/zope/traversing/tests/test_presentation.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/tests/test_presentation.py	2006-04-05 15:01:06 UTC (rev 66547)
+++ Zope3/branches/jim-adapter/src/zope/traversing/tests/test_presentation.py	2006-04-05 15:05:59 UTC (rev 66548)
@@ -17,7 +17,7 @@
 """
 from unittest import TestCase, main, makeSuite
 from zope.traversing.namespace import view, resource
-from zope.traversing.browser.tests import browserView, browserResource
+from zope.traversing.testing import browserView, browserResource
 from zope.interface import Interface, implements
 from zope.publisher.browser import TestRequest
 



More information about the Zope3-Checkins mailing list