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
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 @@ from ZopeTestCase import user_password
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
......
......@@ -30,6 +30,7 @@ import interfaces
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 @@ standard_permissions = [access_contents_information, view]
class ZopeTestCase(base.TestCase):
'''Base test case for Zope testing'''
__implements__ = (interfaces.IZopeSecurity,
base.TestCase.__implements__)
implements(interfaces.IZopeSecurity)
_setup_fixture = 1
......@@ -120,9 +120,6 @@ class FunctionalTestCase(functional.Functional, ZopeTestCase):
to turn it into a functional test case.
'''
__implements__ = (functional.Functional.__implements__,
ZopeTestCase.__implements__)
from base import app
from base import close
......
......@@ -23,6 +23,7 @@ import utils
import interfaces
import connections
from zope.interface import implements
from AccessControl.SecurityManagement import noSecurityManager
......@@ -44,8 +45,7 @@ class TestCase(profiler.Profiled, unittest.TestCase, object):
'''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
......
......@@ -122,8 +122,9 @@ Class TestCase
Base test case for Zope testing
(derived from unittest.TestCase)
__implements__ = (IZopeTestCase,
Profiled.__implements__)
Interfaces
implements(IZopeTestCase)
Methods
......@@ -168,8 +169,9 @@ Class ZopeTestCase
Base test case for Zope testing
(derived from base.TestCase)
__implements__ = (IZopeSecurity,
TestCase.__implements__)
Interfaces
implements(IZopeSecurity)
Methods
......@@ -188,8 +190,9 @@ Class FunctionalTestCase
Convenience class for functional unit testing
(derived from Functional and ZopeTestCase)
__implements__ = (Functional.__implements__,
ZopeTestCase.__implements__)
Interfaces
*See base classes*
Methods
......@@ -220,9 +223,9 @@ Class PortalTestCase
Base test case for CMF testing
(derived from base.TestCase)
__implements__ = (IPortalTestCase,
IPortalSecurity,
TestCase.__implements__)
Interfaces
implements(IPortalTestCase, IPortalSecurity)
Methods
......@@ -262,7 +265,9 @@ Class Profiled
Profiling support mix-in for xTestCases
__implements__ = (IProfiled,)
Interfaces
implements(IProfiled)
Methods
......@@ -284,6 +289,10 @@ Class Sandboxed
Sandbox support mix-in for xTestCases
Interfaces
*No interfaces*
Methods
*No public methods*
......@@ -304,7 +313,9 @@ Class Functional
Functional testing mix-in for xTestCases
__implements__ = (IFunctional,)
Interfaces
implements(IFunctional)
Methods
......
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).
......
......@@ -22,6 +22,8 @@ import transaction
import sandbox
import interfaces
from zope.interface import implements
class Functional(sandbox.Sandboxed):
'''Derive from this class and an xTestCase to get functional
......@@ -31,7 +33,7 @@ class Functional(sandbox.Sandboxed):
...
'''
__implements__ = (interfaces.IFunctional,)
implements(interfaces.IFunctional)
def publish(self, path, basic=None, env=None, extra=None,
request_method='GET', stdin=None, handle_errors=True):
......
......@@ -15,7 +15,7 @@
$Id$
"""
from Interface import Interface
from zope.interface import Interface
class IZopeTestCase(Interface):
......
......@@ -18,6 +18,8 @@ $Id$
import os, sys
import interfaces
from zope.interface import implements
# Some distros ship without profile
try:
from profile import Profile
......@@ -69,7 +71,7 @@ class Profiled:
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)
......
......@@ -22,8 +22,8 @@ if __name__ == '__main__':
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):
......
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