Commit 1bcfaa59 authored by Stefan H. Holek's avatar Stefan H. Holek

Switched to Z3 interfaces, mainly because people tell me they

"don't want to see Z2 interfaces anymore".
parent 71f1dd42
...@@ -31,6 +31,7 @@ import base ...@@ -31,6 +31,7 @@ import base
import interfaces import interfaces
import utils import utils
from zope.interface import implements
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager from AccessControl.SecurityManagement import noSecurityManager
...@@ -44,9 +45,8 @@ from ZopeTestCase import user_password ...@@ -44,9 +45,8 @@ from ZopeTestCase import user_password
class PortalTestCase(base.TestCase): class PortalTestCase(base.TestCase):
'''Base test case for testing CMF-style portals''' '''Base test case for testing CMF-style portals'''
__implements__ = (interfaces.IPortalTestCase, implements(interfaces.IPortalTestCase,
interfaces.IPortalSecurity, interfaces.IPortalSecurity)
base.TestCase.__implements__)
_configure_portal = 1 _configure_portal = 1
......
...@@ -30,6 +30,7 @@ import interfaces ...@@ -30,6 +30,7 @@ import interfaces
import utils import utils
import connections import connections
from zope.interface import implements
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager from AccessControl.SecurityManagement import noSecurityManager
...@@ -46,8 +47,7 @@ standard_permissions = [access_contents_information, view] ...@@ -46,8 +47,7 @@ standard_permissions = [access_contents_information, view]
class ZopeTestCase(base.TestCase): class ZopeTestCase(base.TestCase):
'''Base test case for Zope testing''' '''Base test case for Zope testing'''
__implements__ = (interfaces.IZopeSecurity, implements(interfaces.IZopeSecurity)
base.TestCase.__implements__)
_setup_fixture = 1 _setup_fixture = 1
...@@ -120,9 +120,6 @@ class FunctionalTestCase(functional.Functional, ZopeTestCase): ...@@ -120,9 +120,6 @@ class FunctionalTestCase(functional.Functional, ZopeTestCase):
to turn it into a functional test case. to turn it into a functional test case.
''' '''
__implements__ = (functional.Functional.__implements__,
ZopeTestCase.__implements__)
from base import app from base import app
from base import close from base import close
......
...@@ -23,6 +23,7 @@ import utils ...@@ -23,6 +23,7 @@ import utils
import interfaces import interfaces
import connections import connections
from zope.interface import implements
from AccessControl.SecurityManagement import noSecurityManager from AccessControl.SecurityManagement import noSecurityManager
...@@ -44,8 +45,7 @@ class TestCase(profiler.Profiled, unittest.TestCase, object): ...@@ -44,8 +45,7 @@ class TestCase(profiler.Profiled, unittest.TestCase, object):
'''Base test case for Zope testing '''Base test case for Zope testing
''' '''
__implements__ = (interfaces.IZopeTestCase, implements(interfaces.IZopeTestCase)
profiler.Profiled.__implements__)
def afterSetUp(self): def afterSetUp(self):
'''Called after setUp() has completed. This is '''Called after setUp() has completed. This is
......
...@@ -122,8 +122,9 @@ Class TestCase ...@@ -122,8 +122,9 @@ Class TestCase
Base test case for Zope testing Base test case for Zope testing
(derived from unittest.TestCase) (derived from unittest.TestCase)
__implements__ = (IZopeTestCase, Interfaces
Profiled.__implements__)
implements(IZopeTestCase)
Methods Methods
...@@ -168,8 +169,9 @@ Class ZopeTestCase ...@@ -168,8 +169,9 @@ Class ZopeTestCase
Base test case for Zope testing Base test case for Zope testing
(derived from base.TestCase) (derived from base.TestCase)
__implements__ = (IZopeSecurity, Interfaces
TestCase.__implements__)
implements(IZopeSecurity)
Methods Methods
...@@ -188,8 +190,9 @@ Class FunctionalTestCase ...@@ -188,8 +190,9 @@ Class FunctionalTestCase
Convenience class for functional unit testing Convenience class for functional unit testing
(derived from Functional and ZopeTestCase) (derived from Functional and ZopeTestCase)
__implements__ = (Functional.__implements__, Interfaces
ZopeTestCase.__implements__)
*See base classes*
Methods Methods
...@@ -220,9 +223,9 @@ Class PortalTestCase ...@@ -220,9 +223,9 @@ Class PortalTestCase
Base test case for CMF testing Base test case for CMF testing
(derived from base.TestCase) (derived from base.TestCase)
__implements__ = (IPortalTestCase, Interfaces
IPortalSecurity,
TestCase.__implements__) implements(IPortalTestCase, IPortalSecurity)
Methods Methods
...@@ -262,7 +265,9 @@ Class Profiled ...@@ -262,7 +265,9 @@ Class Profiled
Profiling support mix-in for xTestCases Profiling support mix-in for xTestCases
__implements__ = (IProfiled,) Interfaces
implements(IProfiled)
Methods Methods
...@@ -284,6 +289,10 @@ Class Sandboxed ...@@ -284,6 +289,10 @@ Class Sandboxed
Sandbox support mix-in for xTestCases Sandbox support mix-in for xTestCases
Interfaces
*No interfaces*
Methods Methods
*No public methods* *No public methods*
...@@ -304,7 +313,9 @@ Class Functional ...@@ -304,7 +313,9 @@ Class Functional
Functional testing mix-in for xTestCases Functional testing mix-in for xTestCases
__implements__ = (IFunctional,) Interfaces
implements(IFunctional)
Methods Methods
......
0.9.10 (Zope 2.11 edition)
- Switched to Zope3 interfaces.
0.9.9 (Zope 2.11 edition) 0.9.9 (Zope 2.11 edition)
- transaction.commit(1) is deprecated in favor of transaction.savepoint(1). - transaction.commit(1) is deprecated in favor of transaction.savepoint(1).
- Don't break if Python distros ship without profile support (Debian, Ubuntu). - Don't break if Python distros ship without profile support (Debian, Ubuntu).
......
...@@ -22,6 +22,8 @@ import transaction ...@@ -22,6 +22,8 @@ import transaction
import sandbox import sandbox
import interfaces import interfaces
from zope.interface import implements
class Functional(sandbox.Sandboxed): class Functional(sandbox.Sandboxed):
'''Derive from this class and an xTestCase to get functional '''Derive from this class and an xTestCase to get functional
...@@ -31,7 +33,7 @@ class Functional(sandbox.Sandboxed): ...@@ -31,7 +33,7 @@ class Functional(sandbox.Sandboxed):
... ...
''' '''
__implements__ = (interfaces.IFunctional,) implements(interfaces.IFunctional)
def publish(self, path, basic=None, env=None, extra=None, def publish(self, path, basic=None, env=None, extra=None,
request_method='GET', stdin=None, handle_errors=True): request_method='GET', stdin=None, handle_errors=True):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
$Id$ $Id$
""" """
from Interface import Interface from zope.interface import Interface
class IZopeTestCase(Interface): class IZopeTestCase(Interface):
......
...@@ -18,6 +18,8 @@ $Id$ ...@@ -18,6 +18,8 @@ $Id$
import os, sys import os, sys
import interfaces import interfaces
from zope.interface import implements
# Some distros ship without profile # Some distros ship without profile
try: try:
from profile import Profile from profile import Profile
...@@ -69,7 +71,7 @@ class Profiled: ...@@ -69,7 +71,7 @@ class Profiled:
Profiler statistics will be printed after the test results. Profiler statistics will be printed after the test results.
''' '''
__implements__ = (interfaces.IProfiled,) implements(interfaces.IProfiled)
def runcall(self, *args, **kw): def runcall(self, *args, **kw):
return apply(runcall, args, kw) return apply(runcall, args, kw)
......
...@@ -22,8 +22,8 @@ if __name__ == '__main__': ...@@ -22,8 +22,8 @@ if __name__ == '__main__':
from Testing.ZopeTestCase import * from Testing.ZopeTestCase import *
from Testing.ZopeTestCase.interfaces import * from Testing.ZopeTestCase.interfaces import *
from Interface.Verify import verifyClass from zope.interface.verify import verifyClass
from Interface.Verify import verifyObject from zope.interface.verify import verifyObject
class TestAbstractClasses(TestCase): class TestAbstractClasses(TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment