[Zope-Checkins] SVN: Zope/trunk/lib/python/Testing/ZopeTestCase/ Switched to Z3 interfaces, mainly because people tell me they

Stefan H. Holek stefan at epy.co.at
Tue Nov 21 06:08:49 EST 2006


Log message for revision 71237:
  Switched to Z3 interfaces, mainly because people tell me they
  "don't want to see Z2 interfaces anymore".
  

Changed:
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/PortalTestCase.py
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/ZopeTestCase.py
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/base.py
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/doc/API.stx
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/doc/VERSION.txt
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/functional.py
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/interfaces.py
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/profiler.py
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/testInterfaces.py

-=-
Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/PortalTestCase.py
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/PortalTestCase.py	2006-11-21 06:14:00 UTC (rev 71236)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/PortalTestCase.py	2006-11-21 11:08:47 UTC (rev 71237)
@@ -31,6 +31,7 @@
 import interfaces
 import utils
 
+from zope.interface import implements
 from AccessControl import getSecurityManager
 from AccessControl.SecurityManagement import newSecurityManager
 from AccessControl.SecurityManagement import noSecurityManager
@@ -44,9 +45,8 @@
 class PortalTestCase(base.TestCase):
     '''Base test case for testing CMF-style portals'''
 
-    __implements__ = (interfaces.IPortalTestCase,
-                      interfaces.IPortalSecurity,
-                      base.TestCase.__implements__)
+    implements(interfaces.IPortalTestCase,
+               interfaces.IPortalSecurity)
 
     _configure_portal = 1
 

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/ZopeTestCase.py
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/ZopeTestCase.py	2006-11-21 06:14:00 UTC (rev 71236)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/ZopeTestCase.py	2006-11-21 11:08:47 UTC (rev 71237)
@@ -30,6 +30,7 @@
 import utils
 import connections
 
+from zope.interface import implements
 from AccessControl import getSecurityManager
 from AccessControl.SecurityManagement import newSecurityManager
 from AccessControl.SecurityManagement import noSecurityManager
@@ -46,8 +47,7 @@
 class ZopeTestCase(base.TestCase):
     '''Base test case for Zope testing'''
 
-    __implements__ = (interfaces.IZopeSecurity,
-                      base.TestCase.__implements__)
+    implements(interfaces.IZopeSecurity)
 
     _setup_fixture = 1
 
@@ -120,10 +120,7 @@
        to turn it into a functional test case.
     '''
 
-    __implements__ = (functional.Functional.__implements__,
-                      ZopeTestCase.__implements__)
 
-
 from base import app
 from base import close
 

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/base.py
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/base.py	2006-11-21 06:14:00 UTC (rev 71236)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/base.py	2006-11-21 11:08:47 UTC (rev 71237)
@@ -23,6 +23,7 @@
 import interfaces
 import connections
 
+from zope.interface import implements
 from AccessControl.SecurityManagement import noSecurityManager
 
 
@@ -44,8 +45,7 @@
     '''Base test case for Zope testing
     '''
 
-    __implements__ = (interfaces.IZopeTestCase,
-                      profiler.Profiled.__implements__)
+    implements(interfaces.IZopeTestCase)
 
     def afterSetUp(self):
         '''Called after setUp() has completed. This is

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/doc/API.stx
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/doc/API.stx	2006-11-21 06:14:00 UTC (rev 71236)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/doc/API.stx	2006-11-21 11:08:47 UTC (rev 71237)
@@ -122,9 +122,10 @@
     Base test case for Zope testing
     (derived from unittest.TestCase)
 
-    __implements__ = (IZopeTestCase,
-                      Profiled.__implements__)
+    Interfaces
 
+        implements(IZopeTestCase)
+
     Methods
 
         afterSetUp()
@@ -168,9 +169,10 @@
     Base test case for Zope testing
     (derived from base.TestCase)
 
-    __implements__ = (IZopeSecurity,
-                      TestCase.__implements__)
+    Interfaces
 
+        implements(IZopeSecurity)
+
     Methods
 
         setRoles(roles, name=user_name)
@@ -188,9 +190,10 @@
     Convenience class for functional unit testing
     (derived from Functional and ZopeTestCase)
 
-    __implements__ = (Functional.__implements__,
-                      ZopeTestCase.__implements__)
+    Interfaces
 
+        *See base classes*
+
     Methods
 
         *See base classes*
@@ -220,10 +223,10 @@
     Base test case for CMF testing
     (derived from base.TestCase)
 
-    __implements__ = (IPortalTestCase,
-                      IPortalSecurity,
-                      TestCase.__implements__)
+    Interfaces
 
+        implements(IPortalTestCase, IPortalSecurity)
+
     Methods
 
         getPortal()
@@ -262,8 +265,10 @@
 
     Profiling support mix-in for xTestCases
 
-    __implements__ = (IProfiled,)
+    Interfaces
 
+        implements(IProfiled)
+
     Methods
 
         runcall(func, *args, **kw)
@@ -284,6 +289,10 @@
 
     Sandbox support mix-in for xTestCases
 
+    Interfaces
+
+        *No interfaces*
+
     Methods
 
         *No public methods*
@@ -304,8 +313,10 @@
 
     Functional testing mix-in for xTestCases
 
-    __implements__ = (IFunctional,)
+    Interfaces
 
+        implements(IFunctional)
+
     Methods
 
         publish(path, basic=None, env=None, extra=None, request_method='GET', stdin=None)

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt	2006-11-21 06:14:00 UTC (rev 71236)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt	2006-11-21 11:08:47 UTC (rev 71237)
@@ -1,3 +1,6 @@
+0.9.10 (Zope 2.11 edition)
+- Switched to Zope3 interfaces.
+
 0.9.9 (Zope 2.11 edition)
 - transaction.commit(1) is deprecated in favor of transaction.savepoint(1).
 - Don't break if Python distros ship without profile support (Debian, Ubuntu).

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/doc/VERSION.txt
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/doc/VERSION.txt	2006-11-21 06:14:00 UTC (rev 71236)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/doc/VERSION.txt	2006-11-21 11:08:47 UTC (rev 71237)
@@ -1 +1 @@
-ZopeTestCase 0.9.9
+ZopeTestCase 0.9.10

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/functional.py
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/functional.py	2006-11-21 06:14:00 UTC (rev 71236)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/functional.py	2006-11-21 11:08:47 UTC (rev 71237)
@@ -22,7 +22,9 @@
 import sandbox
 import interfaces
 
+from zope.interface import implements
 
+
 class Functional(sandbox.Sandboxed):
     '''Derive from this class and an xTestCase to get functional
        testing support::
@@ -31,7 +33,7 @@
                ...
     '''
 
-    __implements__ = (interfaces.IFunctional,)
+    implements(interfaces.IFunctional)
 
     def publish(self, path, basic=None, env=None, extra=None,
                 request_method='GET', stdin=None, handle_errors=True):

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/interfaces.py
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/interfaces.py	2006-11-21 06:14:00 UTC (rev 71236)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/interfaces.py	2006-11-21 11:08:47 UTC (rev 71237)
@@ -15,7 +15,7 @@
 $Id$
 """
 
-from Interface import Interface
+from zope.interface import Interface
 
 
 class IZopeTestCase(Interface):

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/profiler.py
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/profiler.py	2006-11-21 06:14:00 UTC (rev 71236)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/profiler.py	2006-11-21 11:08:47 UTC (rev 71237)
@@ -18,6 +18,8 @@
 import os, sys
 import interfaces
 
+from zope.interface import implements
+
 # Some distros ship without profile
 try:
     from profile import Profile
@@ -69,7 +71,7 @@
        Profiler statistics will be printed after the test results.
     '''
 
-    __implements__ = (interfaces.IProfiled,)
+    implements(interfaces.IProfiled)
 
     def runcall(self, *args, **kw):
         return apply(runcall, args, kw)

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/testInterfaces.py
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/testInterfaces.py	2006-11-21 06:14:00 UTC (rev 71236)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/testInterfaces.py	2006-11-21 11:08:47 UTC (rev 71237)
@@ -22,8 +22,8 @@
 from Testing.ZopeTestCase import *
 from Testing.ZopeTestCase.interfaces import *
 
-from Interface.Verify import verifyClass
-from Interface.Verify import verifyObject
+from zope.interface.verify import verifyClass
+from zope.interface.verify import verifyObject
 
 
 class TestAbstractClasses(TestCase):



More information about the Zope-Checkins mailing list