[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/app/ Stop using zope.app.tests (and ztapi where possible).

Philipp von Weitershausen philikon at philikon.de
Mon Apr 3 00:59:44 EDT 2006


Log message for revision 66342:
  
  Stop using zope.app.tests (and ztapi where possible).
  
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/app/copypastemove/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/dtmlpage/ftests.py
  U   Zope3/branches/jim-adapter/src/zope/app/file/browser/ftests.py
  U   Zope3/branches/jim-adapter/src/zope/app/onlinehelp/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelp.py
  U   Zope3/branches/jim-adapter/src/zope/app/onlinehelp/tests/test_treeview.py
  U   Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/ftests.py
  U   Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_instance.py
  U   Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py
  U   Zope3/branches/jim-adapter/src/zope/app/workflow/tests/workflowsetup.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/copypastemove/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/copypastemove/__init__.py	2006-04-03 04:59:38 UTC (rev 66341)
+++ Zope3/branches/jim-adapter/src/zope/app/copypastemove/__init__.py	2006-04-03 04:59:44 UTC (rev 66342)
@@ -688,7 +688,7 @@
 
     Finally, we need to register our handler for copy events:
 
-      >>> from zope.app.tests import ztapi
+      >>> from zope.app.testing import ztapi
       >>> from zope.app.event.interfaces import IObjectCopiedEvent
       >>> ztapi.subscribe([None, IObjectCopiedEvent], None, handler)
 

Modified: Zope3/branches/jim-adapter/src/zope/app/dtmlpage/ftests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/dtmlpage/ftests.py	2006-04-03 04:59:38 UTC (rev 66341)
+++ Zope3/branches/jim-adapter/src/zope/app/dtmlpage/ftests.py	2006-04-03 04:59:44 UTC (rev 66342)
@@ -111,7 +111,7 @@
 
 
 def test_suite():
-    from zope.app.tests import functional
+    from zope.app.testing import functional
     return unittest.TestSuite((
         unittest.makeSuite(DTMLPageTest),
         functional.FunctionalDocFileSuite('url.txt'),

Modified: Zope3/branches/jim-adapter/src/zope/app/file/browser/ftests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/file/browser/ftests.py	2006-04-03 04:59:38 UTC (rev 66341)
+++ Zope3/branches/jim-adapter/src/zope/app/file/browser/ftests.py	2006-04-03 04:59:44 UTC (rev 66342)
@@ -264,7 +264,7 @@
         self.checkForBrokenLinks(body, '/image/@@preview.html', 'mgr:mgrpw')
 
 def test_suite():
-    from zope.app.tests import functional
+    from zope.app.testing import functional
     return unittest.TestSuite((
         unittest.makeSuite(FileTest),
         unittest.makeSuite(ImageTest),

Modified: Zope3/branches/jim-adapter/src/zope/app/onlinehelp/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/onlinehelp/__init__.py	2006-04-03 04:59:38 UTC (rev 66341)
+++ Zope3/branches/jim-adapter/src/zope/app/onlinehelp/__init__.py	2006-04-03 04:59:44 UTC (rev 66342)
@@ -61,7 +61,7 @@
     >>> import os
     >>> from tests.test_onlinehelp import testdir
     >>> from tests.test_onlinehelp import I1, Dummy1, Dummy2
-    >>> from zope.app.tests import ztapi
+    >>> from zope.app.testing import ztapi
     >>> from zope.component.interfaces import IFactory
     >>> from zope.component.factory import Factory
     >>> from zope.app.onlinehelp.onlinehelptopic import OnlineHelpTopic

Modified: Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelp.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelp.py	2006-04-03 04:59:38 UTC (rev 66341)
+++ Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelp.py	2006-04-03 04:59:44 UTC (rev 66342)
@@ -33,7 +33,7 @@
 class OnlineHelp(OnlineHelpTopic):
     """
     >>> import os
-    >>> from zope.app.tests import ztapi
+    >>> from zope import component
     >>> from zope.component.interfaces import IFactory
     >>> from zope.component.factory import Factory
     >>> from zope.app.onlinehelp.tests.test_onlinehelp import testdir
@@ -63,10 +63,10 @@
     >>> rest = Factory(RESTOnlineHelpTopic)
     >>> stx = Factory(STXOnlineHelpTopic)
     >>> zpt = Factory(ZPTOnlineHelpTopic)
-    >>> ztapi.provideUtility(IFactory, default, 'onlinehelp.topic.default')
-    >>> ztapi.provideUtility(IFactory, rest, 'onlinehelp.topic.rest')
-    >>> ztapi.provideUtility(IFactory, stx, 'onlinehelp.topic.stx')
-    >>> ztapi.provideUtility(IFactory, zpt, 'onlinehelp.topic.zpt')
+    >>> component.provideUtility(default, IFactory, 'onlinehelp.topic.default')
+    >>> component.provideUtility(rest, IFactory, 'onlinehelp.topic.rest')
+    >>> component.provideUtility(stx, IFactory, 'onlinehelp.topic.stx')
+    >>> component.provideUtility(zpt, IFactory, 'onlinehelp.topic.zpt')
     >>> path = os.path.join(testdir(), 'help2.txt')
     >>> onlinehelp.registerHelpTopic('', 'help2', 'Help 2',
     ...     path, I1, 'view.html')

Modified: Zope3/branches/jim-adapter/src/zope/app/onlinehelp/tests/test_treeview.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/onlinehelp/tests/test_treeview.py	2006-04-03 04:59:38 UTC (rev 66341)
+++ Zope3/branches/jim-adapter/src/zope/app/onlinehelp/tests/test_treeview.py	2006-04-03 04:59:44 UTC (rev 66342)
@@ -19,10 +19,10 @@
 
 from unittest import TestCase, TestLoader, TextTestRunner
 
+from zope import component
 from zope.pagetemplate.tests.util import check_xml
 from zope.publisher.browser import TestRequest
 from zope.app.site.tests.placefulsetup import PlacefulSetup
-from zope.app.tests import ztapi
 from zope.app.onlinehelp.tests import util
 from zope.app.onlinehelp.interfaces import IOnlineHelp, IOnlineHelpTopic
 from zope.app.onlinehelp.onlinehelp import OnlineHelp
@@ -41,7 +41,7 @@
         PlacefulSetup.setUp(self, site=True)
         path = os.path.join(testdir(), 'help.txt')
         self.onlinehelp = OnlineHelp('Help', path)
-        ztapi.provideUtility(IOnlineHelp, self.onlinehelp, "OnlineHelp")
+        component.provideUtility(self.onlinehelp, IOnlineHelp, "OnlineHelp")
 
     def test_onlinehelp(self):
         view = OnlineHelpTopicTreeView

Modified: Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/ftests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/ftests.py	2006-04-03 04:59:38 UTC (rev 66341)
+++ Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/ftests.py	2006-04-03 04:59:44 UTC (rev 66342)
@@ -17,12 +17,12 @@
 """
 import unittest
 
+import zope.component
 from zope.app.testing import functional
 from zope.app.security.interfaces import IPermission
 from zope.app.security.permission import Permission
 from zope.app.securitypolicy.role import Role
 from zope.app.securitypolicy.interfaces import IRole
-from zope.app.tests import ztapi
 
 
 class RolePermissionsTest(functional.BrowserTestCase):
@@ -87,7 +87,7 @@
 
     def testAllRolePermissionsFormForLocalRoles(self):
         role = Role(u"id", u"Local Role")
-        ztapi.provideUtility(IRole, role)
+        zope.component.provideUtility(role, IRole)
         self.testAllRolePermissions()
 
         response = self.publish(
@@ -98,7 +98,7 @@
 
     def testAllRolePermissionsFormForLocalPermissions(self):
         permission = Permission(u"id", u"Local Permission")
-        ztapi.provideUtility(IPermission, permission)
+        zope.component.provideUtility(permission, IPermission)
         self.testAllRolePermissions()
 
         response = self.publish(
@@ -109,7 +109,7 @@
 
     def testRolesWithPermissionsFormForLocalPermission(self):
         permission = Permission(u"id", u"Local Permission")
-        ztapi.provideUtility(IPermission, permission)
+        zope.component.provideUtility(permission, IPermission)
 
         response = self.publish(
             '/++etc++site/@@AllRolePermissions.html',

Modified: Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_instance.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_instance.py	2006-04-03 04:59:38 UTC (rev 66341)
+++ Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_instance.py	2006-04-03 04:59:44 UTC (rev 66342)
@@ -21,6 +21,7 @@
 from zope.interface.verify import verifyClass
 from zope.schema import Text, Int
 
+from zope import component
 from zope.app.event.tests.placelesssetup import events, clearEvents
 from zope.app.security.interfaces import IPermission
 from zope.app.security.permission import Permission
@@ -28,7 +29,6 @@
 from zope.security.management import newInteraction, endInteraction
 
 from zope.app.annotation.interfaces import IAttributeAnnotatable
-from zope.app.servicenames import Utilities
 
 from zope.app.workflow.tests.workflowsetup import WorkflowSetup
 from zope.app.workflow.interfaces import IProcessDefinition
@@ -45,7 +45,6 @@
 from zope.app.workflow.stateful.instance import StateChangeInfo
 
 from zope.app import zapi
-from zope.app.tests import ztapi
 from zope.app.container.contained import contained
 from zope.app.utility import UtilityRegistration
 from zope.app.testing import setup
@@ -344,7 +343,7 @@
     def setUp(self):
         WorkflowSetup.setUp(self)
 
-        ztapi.provideUtility(IPermission, Permission('deny', 'Deny'), 'deny')
+        component.provideUtility(Permission('deny', 'Deny'), IPermission, 'deny')
 
         endInteraction()
         newInteraction(ParticipationStub('test'))

Modified: Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py	2006-04-03 04:59:38 UTC (rev 66341)
+++ Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py	2006-04-03 04:59:44 UTC (rev 66342)
@@ -34,7 +34,7 @@
 from zope.app.workflow.stateful.definition import State, Transition
 from zope.app.workflow.stateful.xmlimportexport import XMLExportHandler
 from zope.app.workflow.stateful.xmlimportexport import XMLImportHandler
-from zope.app.tests import ztapi
+from zope.app.testing import ztapi
 from zope.interface import implements, classImplements, Interface
 from zope.interface.verify import verifyClass
 from zope.schema import TextLine

Modified: Zope3/branches/jim-adapter/src/zope/app/workflow/tests/workflowsetup.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/workflow/tests/workflowsetup.py	2006-04-03 04:59:38 UTC (rev 66341)
+++ Zope3/branches/jim-adapter/src/zope/app/workflow/tests/workflowsetup.py	2006-04-03 04:59:44 UTC (rev 66342)
@@ -1,4 +1,4 @@
- ##############################################################################
+##############################################################################
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
@@ -25,30 +25,24 @@
 from zope.app.servicenames import Authentication, Utilities
 from zope.app.site.tests.placefulsetup import PlacefulSetup
 from zope.app.utility import LocalUtilityService
-from zope.app.tests import setup
+from zope.app.testing import setup
 
 
 class WorkflowSetup(PlacefulSetup):
 
     def setUp(self):
-        #getGlobalServices has been moved 
-        #self.root_sm = zapi.getGlobalServices()
         self.root_sm = zapi.getGlobalSiteManager()
 
         self.sm = PlacefulSetup.setUp(self, site=True)
         setup.addService(self.sm, Utilities, LocalUtilityService())
 
         self.default = zapi.traverse(self.sm, "default")
-        #moved to registrationManager
-        #self.cm = self.default.getRegistrationManager()
         self.cm = self.default.registrationManager
 
         self.sm1 = self.makeSite('folder1')
         setup.addService(self.sm1, Utilities, LocalUtilityService())
 
         self.default1 = zapi.traverse(self.sm1, "default")
-        #moved to registrationManager
-        #self.cm1 = self.default1.getRegistrationManager()
         self.cm1 = self.default1.registrationManager
 
 



More information about the Zope3-Checkins mailing list