[Zope3-checkins] CVS: Zope3/src/zope/component/tests - components.py:1.4.22.1 factory.py:1.2.26.1 placelesssetup.py:1.5.22.1 test_api.py:1.8.2.1 test_resources.py:1.6.10.1 test_service.py:1.2.26.1 test_skins.py:1.4.10.1 test_utilityservice.py:1.5.10.1 views.py:1.2.26.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:24:09 -0400
Update of /cvs-repository/Zope3/src/zope/component/tests
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/component/tests
Modified Files:
Tag: cw-mail-branch
components.py factory.py placelesssetup.py test_api.py
test_resources.py test_service.py test_skins.py
test_utilityservice.py views.py
Log Message:
Synced up with HEAD
=== Zope3/src/zope/component/tests/components.py 1.4 => 1.4.22.1 ===
--- Zope3/src/zope/component/tests/components.py:1.4 Tue Feb 18 14:40:29 2003
+++ Zope3/src/zope/component/tests/components.py Sun Jun 22 10:23:38 2003
@@ -17,8 +17,7 @@
"""
__metaclass__ = type # All classes are new style when run with Python 2.2+
-from zope.interface import Interface
-from zope.interface import Attribute
+from zope.interface import Interface, Attribute, implements
class RecordingAdapter:
@@ -49,11 +48,12 @@
class IContent(Interface): pass
-class Content: __implements__ = IContent
+class Content:
+ implements(IContent)
class Comp:
__used_for__ = IContent
- __implements__ = IApp
+ implements(IApp)
def __init__(self, *args):
# Ignore arguments passed to constructor
=== Zope3/src/zope/component/tests/factory.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/component/tests/factory.py:1.2 Wed Dec 25 09:13:32 2002
+++ Zope3/src/zope/component/tests/factory.py Sun Jun 22 10:23:38 2003
@@ -16,26 +16,26 @@
$Id$
"""
from zope.component.interfaces import IFactory
-from zope.interface import Interface
+from zope.interface import Interface, implements, implementedBy
class IX(Interface):
"""the dummy interface which class X supposedly implements,
according to the factory"""
class X:
- __implements__=IX
+ implements(IX)
def __init__(self, *args, **kwargs):
self.args=args
self.kwargs=kwargs
class ClassFactoryWrapper:
- __implements__ = IFactory
+ implements(IFactory)
def __init__(self, klass):
self.__klass=klass
def __call__(self, *args, **kwargs):
return self.__klass(*args, **kwargs)
def getInterfaces(self):
- return getattr(self.__klass,'__implements__', None)
+ return implementedBy(self.__klass)
f=ClassFactoryWrapper(X)
=== Zope3/src/zope/component/tests/placelesssetup.py 1.5 => 1.5.22.1 ===
--- Zope3/src/zope/component/tests/placelesssetup.py:1.5 Tue Feb 11 21:17:43 2003
+++ Zope3/src/zope/component/tests/placelesssetup.py Sun Jun 22 10:23:38 2003
@@ -27,37 +27,37 @@
class PlacelessSetup(CleanUp):
def setUp(self):
CleanUp.setUp(self)
- sm=getServiceManager(None)
- defineService=sm.defineService
- provideService=sm.provideService
+ sm = getServiceManager(None)
+ defineService = sm.defineService
+ provideService = sm.provideService
# factory service
from zope.component.interfaces import IFactoryService
- defineService(Factories,IFactoryService)
+ defineService(Factories, IFactoryService)
from zope.component.factory import factoryService
provideService(Factories, factoryService)
# utility service
from zope.component.interfaces import IUtilityService
- defineService(Utilities,IUtilityService)
+ defineService(Utilities, IUtilityService)
from zope.component.utility import utilityService
provideService(Utilities, utilityService)
# adapter service
from zope.component.interfaces import IAdapterService
- defineService(Adapters,IAdapterService)
+ defineService(Adapters, IAdapterService)
from zope.component.adapter import adapterService
provideService(Adapters, adapterService)
# resource service
from zope.component.interfaces import IResourceService
- defineService(Resources,IResourceService)
+ defineService(Resources, IResourceService)
from zope.component.resource import resourceService
provideService(Resources, resourceService)
# skin service
from zope.component.interfaces import ISkinService
- defineService(Skins,ISkinService)
+ defineService(Skins, ISkinService)
from zope.component.skin import skinService
provideService(Skins, skinService)
# view service
from zope.component.interfaces import IViewService
- defineService('Views',IViewService)
+ defineService('Views', IViewService)
from zope.component.view import viewService
provideService('Views', viewService)
def tearDown(self):
=== Zope3/src/zope/component/tests/test_api.py 1.8 => 1.8.2.1 ===
--- Zope3/src/zope/component/tests/test_api.py:1.8 Wed May 21 16:30:06 2003
+++ Zope3/src/zope/component/tests/test_api.py Sun Jun 22 10:23:38 2003
@@ -20,23 +20,23 @@
from zope.component import getUtility, queryUtility
from zope.component.servicenames import Adapters
from zope.component.tests.request import Request
-from zope.interface import Interface
+from zope.interface import Interface, implements
class I1(Interface): pass
class I2(Interface): pass
class I3(Interface): pass
class Comp:
- __implements__ = I2
+ implements(I2)
def __init__(self, context, request=None): self.context = context
class Comp2:
- __implements__ = I3
+ implements(I3)
def __init__(self, context, request=None): self.context = context
comp = Comp(1)
class Ob:
- __implements__ = I1
+ implements(I1)
ob = Ob()
@@ -105,7 +105,7 @@
provideAdapter = adapterService.provideAdapter
getAdapter = adapterService.getAdapter
queryAdapter = adapterService.queryAdapter
-
+
ob = Conforming()
# If an object implements the interface you want to adapt to,
=== Zope3/src/zope/component/tests/test_resources.py 1.6 => 1.6.10.1 ===
--- Zope3/src/zope/component/tests/test_resources.py:1.6 Thu May 1 15:35:39 2003
+++ Zope3/src/zope/component/tests/test_resources.py Sun Jun 22 10:23:38 2003
@@ -23,7 +23,7 @@
from zope.component import getResource, queryResource
from zope.component.exceptions import ComponentLookupError
from zope.component.servicenames import Skins, Resources
-from zope.interface import Interface
+from zope.interface import Interface, implements
from zope.component.tests.request import Request
class Test(PlacelessSetup, unittest.TestCase):
@@ -32,7 +32,7 @@
class I2(Interface): pass
class C1:
def __init__(self, request): pass
- __implements__ = I2
+ implements(I2)
class C2(C1): pass
getService(None,Resources).provideResource('test', I2, C1)
@@ -52,7 +52,7 @@
class C1:
def __init__(self, request): pass
- __implements__ = I2
+ implements(I2)
class C2(C1): pass
=== Zope3/src/zope/component/tests/test_service.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/component/tests/test_service.py:1.2 Wed Dec 25 09:13:32 2002
+++ Zope3/src/zope/component/tests/test_service.py Sun Jun 22 10:23:38 2003
@@ -17,7 +17,7 @@
"""
import unittest
-from zope.interface import Interface
+from zope.interface import Interface, implements
from zope.exceptions import DuplicationError
from zope.testing.cleanup import CleanUp
@@ -37,10 +37,10 @@
pass
class ServiceOne:
- __implements__ = IOne
+ implements(IOne)
class ServiceTwo:
- __implements__ = ITwo
+ implements(ITwo)
class Test(CleanUp, unittest.TestCase):
=== Zope3/src/zope/component/tests/test_skins.py 1.4 => 1.4.10.1 ===
--- Zope3/src/zope/component/tests/test_skins.py:1.4 Thu May 1 15:35:39 2003
+++ Zope3/src/zope/component/tests/test_skins.py Sun Jun 22 10:23:38 2003
@@ -17,7 +17,7 @@
from zope.component import getView, getService, queryView
from zope.component.exceptions import ComponentLookupError
from zope.component.servicenames import Skins
-from zope.interface import Interface
+from zope.interface import Interface, implements
from zope.component.tests.request import Request
@@ -28,13 +28,14 @@
class I2(Interface): pass
class C1:
- __implements__ = I2
+ implements(I2)
__used_for__ = I1
def __init__(self, o, request): self._context=o
class C2(C1): pass
class C3(C1): pass
- class O: __implements__ = I1
+ class O:
+ implements(I1)
getService(None, 'Views').provideView(I1, 'test', I2, [C1])
self.assertEqual(getView(O(), 'test', Request(I2)).__class__, C1)
@@ -61,13 +62,14 @@
class I2(Interface): pass
class C1:
- __implements__ = I2
+ implements(I2)
__used_for__ = I1
def __init__(self, o, request): self._context=o
class C2(C1): pass
class C3(C1): pass
- class O: __implements__ = I1
+ class O:
+ implements(I1)
getService(None, 'Views').provideView(I1, 'test', I2, [C1])
@@ -97,7 +99,6 @@
self.assertEqual(queryView(O(), 'test2',
Request(I2, 'foo'), None), None)
-
def test_suite():
=== Zope3/src/zope/component/tests/test_utilityservice.py 1.5 => 1.5.10.1 ===
--- Zope3/src/zope/component/tests/test_utilityservice.py:1.5 Thu May 1 15:35:39 2003
+++ Zope3/src/zope/component/tests/test_utilityservice.py Sun Jun 22 10:23:38 2003
@@ -23,7 +23,7 @@
getUtility, getService, queryUtility, getServiceManager
from zope.component.exceptions import ComponentLookupError
from zope.component.servicenames import Utilities
-from zope.interface import Interface
+from zope.interface import Interface, implements
from zope.testing.cleanup import CleanUp # Base class w registry cleanup
@@ -31,7 +31,7 @@
pass
class DummyService:
- __implements__ = IDummyService
+ implements(IDummyService)
dummyService = DummyService()
=== Zope3/src/zope/component/tests/views.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/component/tests/views.py:1.2 Wed Dec 25 09:13:32 2002
+++ Zope3/src/zope/component/tests/views.py Sun Jun 22 10:23:38 2003
@@ -16,7 +16,7 @@
Revision information: $Id$
"""
-from zope.interface import Interface
+from zope.interface import Interface, implements
class IV(Interface):
@@ -25,7 +25,7 @@
class IC(Interface): pass
class V1:
- __implements__ = IV
+ implements(IV)
def __init__(self,context, request):
self.context = context
@@ -47,7 +47,7 @@
def __init__(self, request):
pass
- __implements__ = IV
+ implements(IV)
class RZMI(R1):
pass