[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/traversing/ More ztapi killing

Philipp von Weitershausen philikon at philikon.de
Wed Apr 5 10:53:21 EDT 2006


Log message for revision 66546:
  More ztapi killing
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/traversing/browser/tests.py
  U   Zope3/branches/jim-adapter/src/zope/traversing/ftests/test_vhosting.py
  U   Zope3/branches/jim-adapter/src/zope/traversing/tests/test_presentation.py
  U   Zope3/branches/jim-adapter/src/zope/traversing/tests/test_skin.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 14:45:43 UTC (rev 66545)
+++ Zope3/branches/jim-adapter/src/zope/traversing/browser/tests.py	2006-04-05 14:53:20 UTC (rev 66546)
@@ -43,6 +43,10 @@
     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/ftests/test_vhosting.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/ftests/test_vhosting.py	2006-04-05 14:45:43 UTC (rev 66545)
+++ Zope3/branches/jim-adapter/src/zope/traversing/ftests/test_vhosting.py	2006-04-05 14:53:20 UTC (rev 66546)
@@ -17,12 +17,14 @@
 """
 import unittest
 import transaction
-from zope.app.testing import ztapi, functional
-from zope.app.folder import Folder
-from zope.app.publisher.browser.resource import Resource
 from zope.traversing.api import traverse
+from zope.traversing.browser.tests import browserResource
 from zope.security.checker import defineChecker, NamesChecker, NoProxy
 from zope.security.checker import _checkers, undefineChecker
+
+from zope.app.testing import functional
+from zope.app.folder import Folder
+from zope.app.publisher.browser.resource import Resource
 from zope.app.container.contained import Contained
 from zope.app.zptpage.zptpage import ZPTPage
 
@@ -131,7 +133,7 @@
                     'https://otherhost/bar/pt\n')
 
     def test_resources(self):
-        ztapi.browserResource('quux', Resource)
+        browserResource('quux', Resource)
         # Only register the checker once, so that multiple test runs pass.
         if Resource not in _checkers:
             defineChecker(Resource, NamesChecker(['__call__']))

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 14:45:43 UTC (rev 66545)
+++ Zope3/branches/jim-adapter/src/zope/traversing/tests/test_presentation.py	2006-04-05 14:53:20 UTC (rev 66546)
@@ -17,11 +17,10 @@
 """
 from unittest import TestCase, main, makeSuite
 from zope.traversing.namespace import view, resource
+from zope.traversing.browser.tests import browserView, browserResource
 from zope.interface import Interface, implements
 from zope.publisher.browser import TestRequest
 
-from zope.app.testing import ztapi
-
 class IContent(Interface):
     pass
 
@@ -42,14 +41,14 @@
 class Test(TestCase):
 
     def testView(self):
-        ztapi.browserView(IContent, 'foo', View)
+        browserView(IContent, 'foo', View)
 
         ob = Content()
         v = view(ob, TestRequest()).traverse('foo', ())
         self.assertEqual(v.__class__, View)
 
     def testResource(self):
-        ztapi.browserResource('foo', Resource)
+        browserResource('foo', Resource)
 
         ob = Content()
         r = resource(ob, TestRequest()).traverse('foo', ())

Modified: Zope3/branches/jim-adapter/src/zope/traversing/tests/test_skin.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/tests/test_skin.py	2006-04-05 14:45:43 UTC (rev 66545)
+++ Zope3/branches/jim-adapter/src/zope/traversing/tests/test_skin.py	2006-04-05 14:53:20 UTC (rev 66546)
@@ -16,12 +16,11 @@
 $Id$
 """
 from unittest import TestCase, main, makeSuite
-from zope.interface import Interface, directlyProvides
 
+import zope.component
+from zope.interface import Interface, directlyProvides
 from zope.publisher.interfaces.browser import IBrowserSkinType
-from zope.app.testing import ztapi
 
-
 class FauxRequest(object):
     def shiftNameToApplication(self):
         self.shifted = 1
@@ -35,7 +34,7 @@
 
     def setUp(self):
         super(Test, self).setUp()
-        ztapi.provideUtility(IBrowserSkinType, IFoo, 'foo')
+        zope.component.provideUtility(IFoo, IBrowserSkinType, name='foo')
 
     def test(self):
         from zope.traversing.namespace import skin



More information about the Zope3-Checkins mailing list