[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_adapter.py:1.18 test_configurations.py:1.8 test_configurationstatusproperty.py:1.8 test_cookiesessionservice.py:1.4 test_field.py:1.8 test_interface.py:1.7 test_module.py:1.9 test_objecthub.py:1.10 test_principalannotation.py:1.8 test_useconfiguration.py:1.3 test_utility.py:1.8 test_view.py:1.16
Steve Alexander
steve@cat-box.net
Sat, 7 Jun 2003 01:32:02 -0400
Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv27624/src/zope/app/services/tests
Modified Files:
test_adapter.py test_configurations.py
test_configurationstatusproperty.py
test_cookiesessionservice.py test_field.py test_interface.py
test_module.py test_objecthub.py test_principalannotation.py
test_useconfiguration.py test_utility.py test_view.py
Log Message:
new interface declarations
=== Zope3/src/zope/app/services/tests/test_adapter.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/services/tests/test_adapter.py:1.17 Tue Jun 3 18:46:22 2003
+++ Zope3/src/zope/app/services/tests/test_adapter.py Sat Jun 7 01:32:01 2003
@@ -19,7 +19,7 @@
from unittest import TestCase, TestSuite, main, makeSuite
from zope.app.services.tests.iconfigurable import TestingIConfigurable
from zope.app.services.adapter import AdapterService
-from zope.interface import Interface, directlyProvides
+from zope.interface import Interface, directlyProvides, implements
from zope.app.context import ContextWrapper
from zope.component.exceptions import ComponentLookupError
from zope.app.services.tests.placefulsetup import PlacefulSetup
@@ -109,7 +109,7 @@
def test_queryAdapter_no_adapter(self):
service = self._service
class O:
- __implements__ = I1
+ implements(I1)
o = O()
self.assertEqual(service.queryAdapter(o, I2), None)
@@ -121,7 +121,7 @@
def test_getAdapter_no_adapter(self):
service = self._service
class O:
- __implements__ = I1
+ implements(I1)
o = O()
self.assertRaises(ComponentLookupError, service.getAdapter, O(), I2)
@@ -138,7 +138,7 @@
configuration = traverse(configure, '1')
class O:
- __implements__ = I1
+ implements(I1)
configuration.factory = A
@@ -177,7 +177,7 @@
configuration = traverse(configure, '1')
class O:
- __implements__ = I1
+ implements(I1)
configuration.factory = A
@@ -226,7 +226,7 @@
configuration = traverse(configure, '1')
class O:
- __implements__ = I1
+ implements(I1)
configuration.factory = A
@@ -248,7 +248,7 @@
service = self._service
class O:
- __implements__ = I1
+ implements(I1)
o = O()
@@ -270,7 +270,7 @@
class PhonyServiceManager:
- __implements__ = IServiceService
+ implements(IServiceService)
def resolve(self, name):
if name == 'Foo.Bar.A':
@@ -278,7 +278,6 @@
def getService(self, name):
return serviceManager.getService(name)
-
class TestAdapterConfiguration(PlacefulSetup, TestCase):
=== Zope3/src/zope/app/services/tests/test_configurations.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/tests/test_configurations.py:1.7 Tue Jun 3 17:43:00 2003
+++ Zope3/src/zope/app/services/tests/test_configurations.py Sat Jun 7 01:32:01 2003
@@ -18,7 +18,7 @@
from unittest import TestCase, TestSuite, main, makeSuite
-from zope.interface import Interface
+from zope.interface import Interface, implements
from zope.app.interfaces.services.configuration \
import Active, Registered, Unregistered
from zope.app.interfaces.dependable import DependencyError
@@ -36,7 +36,7 @@
class ComponentStub:
- __implements__ = IDependable
+ implements(IDependable)
_dependents = ()
@@ -54,7 +54,6 @@
def dependents(self):
return self._dependents
-
class TestSimpleConfiguration(TestCase):
=== Zope3/src/zope/app/services/tests/test_configurationstatusproperty.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/tests/test_configurationstatusproperty.py:1.7 Tue Jun 3 17:43:00 2003
+++ Zope3/src/zope/app/services/tests/test_configurationstatusproperty.py Sat Jun 7 01:32:01 2003
@@ -30,6 +30,8 @@
from zope.app.context import ContextWrapper
from zope.component.exceptions import ComponentLookupError
from zope.app.interfaces.services.configuration import NoLocalServiceError
+from zope.interface import implements
+
class TestingConfiguration(TestingConfiguration):
status = ConfigurationStatusProperty("Services")
@@ -46,7 +48,7 @@
class TestingServiceManager:
- __implements__ = IServiceService # I lied
+ implements(IServiceService) # I lied
registry = None
@@ -170,7 +172,7 @@
self.assertEqual(configa.status, Unregistered)
else:
self.fail("should complain about missing service")
-
+
def test_suite():
return TestSuite((
=== Zope3/src/zope/app/services/tests/test_cookiesessionservice.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/services/tests/test_cookiesessionservice.py:1.3 Fri Feb 28 09:19:38 2003
+++ Zope3/src/zope/app/services/tests/test_cookiesessionservice.py Sat Jun 7 01:32:01 2003
@@ -20,12 +20,13 @@
from zope.app.interfaces.services.session import ISessionService
from zope.app.interfaces.services.session import ISessionDataManager
from zope.app.services.session import CookieSessionService
+from zope.interface import implements
import time
class DummyDataManager:
- __implements__ = ISessionDataManager
+ implements(ISessionDataManager)
def __init__(self):
self.data = {}
=== Zope3/src/zope/app/services/tests/test_field.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/tests/test_field.py:1.7 Fri May 23 13:51:36 2003
+++ Zope3/src/zope/app/services/tests/test_field.py Sat Jun 7 01:32:01 2003
@@ -20,13 +20,13 @@
from zope.app.services.tests.placefulsetup import PlacefulSetup
from zope.app.traversing import traverse
from zope.schema.interfaces import ValidationError
-from zope.interface import Interface
+from zope.interface import Interface, implements
from zope.app.interfaces.services.module import IModuleService
from zope.component.interfaces import IServiceService
class ModuleService:
- __implements__ = IModuleService, IServiceService
+ implements(IModuleService, IServiceService)
# I'm lying about implementing IServiceService, but that is needed to get
# a ModuleService as a service manager. (See XXX comment in module.py.)
def __init__(self, name=None, component=None):
@@ -45,7 +45,7 @@
class I1(Interface): pass
class C:
- __implements__ = I1
+ implements(I1)
class D:
pass
=== Zope3/src/zope/app/services/tests/test_interface.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/services/tests/test_interface.py:1.6 Sat May 3 12:33:22 2003
+++ Zope3/src/zope/app/services/tests/test_interface.py Sat Jun 7 01:32:01 2003
@@ -48,7 +48,7 @@
def tearDown(self):
get_transaction().abort() # just in case
-
+
def test_creation(self):
class IFoo(PersistentInterface):
pass
@@ -66,11 +66,11 @@
# test for a pickling bug
self.assertEqual(imodule.Foo.__implements__, imodule.IFoo)
-
+
self.assert_(imodule.IFoo.isImplementedBy(imodule.aFoo))
# the conversion should not affect Interface
self.assert_(imodule.Interface is Interface)
-
+
def test_suite():
return unittest.makeSuite(PersistentInterfaceTest)
=== Zope3/src/zope/app/services/tests/test_module.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/services/tests/test_module.py:1.8 Tue Jun 3 18:46:22 2003
+++ Zope3/src/zope/app/services/tests/test_module.py Sat Jun 7 01:32:01 2003
@@ -18,7 +18,7 @@
"""
from unittest import TestCase, TestLoader, TextTestRunner
-from zope.interface import Interface
+from zope.interface import Interface, implements
from zope.app.services.tests.placefulsetup import PlacefulSetup
from zope.app.traversing import traverse
from zope.app.services.module import Manager
@@ -32,7 +32,7 @@
class TestService:
- __implements__ = ITestService
+ implements(ITestService)
class ServiceManagerTests(PlacefulSetup, TestCase):
=== Zope3/src/zope/app/services/tests/test_objecthub.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/services/tests/test_objecthub.py:1.9 Thu May 1 15:35:35 2003
+++ Zope3/src/zope/app/services/tests/test_objecthub.py Sat Jun 7 01:32:01 2003
@@ -40,6 +40,7 @@
from zope.exceptions import NotFoundError
from zope.app.traversing import canonicalPath
+from zope.interface import implements
# while these tests don't really test much of the placeful aspect of the
# object hub, they do at least test basic functionality.
@@ -209,7 +210,7 @@
from zope.app.interfaces.traversing import ITraverser
from zope.app.traversing.adapters import Traverser
class DummyTraverser(Traverser):
- __implements__ = ITraverser
+ implements(ITraverser)
def traverse(self, location, *args, **kw):
if location in TestSearchRegistrations.locations:
return fake_object_for_location(location)
=== Zope3/src/zope/app/services/tests/test_principalannotation.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/tests/test_principalannotation.py:1.7 Tue Jun 3 18:46:22 2003
+++ Zope3/src/zope/app/services/tests/test_principalannotation.py Sat Jun 7 01:32:01 2003
@@ -29,11 +29,12 @@
from zope.app.interfaces.annotation import IAnnotations
from zope.app.interfaces.security import IPrincipal
from zope.app.tests import setup
+from zope.interface import implements
class Principal:
- __implements__ = IPrincipal
+ implements(IPrincipal)
def __init__(self, id):
self.id = id
=== Zope3/src/zope/app/services/tests/test_useconfiguration.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/tests/test_useconfiguration.py:1.2 Mon Mar 3 18:16:14 2003
+++ Zope3/src/zope/app/services/tests/test_useconfiguration.py Sat Jun 7 01:32:01 2003
@@ -19,15 +19,17 @@
from zope.app.services.configuration import UseConfiguration
from zope.app.interfaces.annotation import IAnnotations
from zope.app.tests.placelesssetup import PlacelessSetup
+from zope.interface import implements
class C(dict):
- __implements__ = IAnnotations
+ implements(IAnnotations)
class TestUseConfiguration(PlacelessSetup, TestCase):
def testVerifyInterface(self):
from zope.interface.verify import verifyObject
- from zope.app.interfaces.services.configuration import IUseConfiguration
+ from zope.app.interfaces.services.configuration import \
+ IUseConfiguration
obj = UseConfiguration(C())
verifyObject(IUseConfiguration, obj)
=== Zope3/src/zope/app/services/tests/test_utility.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/tests/test_utility.py:1.7 Tue Jun 3 17:43:00 2003
+++ Zope3/src/zope/app/services/tests/test_utility.py Sat Jun 7 01:32:01 2003
@@ -23,7 +23,7 @@
from zope.app.services.tests import placefulsetup
from zope.app.services import utility
from zope.component.utility import utilityService as globalUtilityService
-from zope.interface import Interface
+from zope.interface import Interface, implements
from zope.component import getService
from zope.component.exceptions import ComponentLookupError
from zope.app.traversing import traverse
@@ -47,7 +47,7 @@
class Foo:
# We implement IUseConfiguration and IDependable directly to
# depend as little as possible on other infrastructure.
- __implements__ = IFoo, ILocalUtility, IUseConfiguration, IDependable
+ implements(IFoo, ILocalUtility, IUseConfiguration, IDependable)
def __init__(self, name):
self.name = name
=== Zope3/src/zope/app/services/tests/test_view.py 1.15 => 1.16 ===
--- Zope3/src/zope/app/services/tests/test_view.py:1.15 Tue Jun 3 17:43:00 2003
+++ Zope3/src/zope/app/services/tests/test_view.py Sat Jun 7 01:32:01 2003
@@ -19,7 +19,7 @@
from unittest import TestCase, TestSuite, main, makeSuite
from zope.app.services.tests.iconfigurable import TestingIConfigurable
from zope.app.services.view import ViewService
-from zope.interface import Interface, directlyProvides
+from zope.interface import Interface, directlyProvides, implements
from zope.app.context import ContextWrapper
from zope.component.exceptions import ComponentLookupError
from zope.app.services.tests.placefulsetup import PlacefulSetup
@@ -69,7 +69,7 @@
class PhonyTemplate:
- __implements__ = IZPTTemplate
+ implements(IZPTTemplate)
class A:
def __init__(self, object, request):
@@ -103,7 +103,7 @@
def test_queryView_no_view(self):
service = self._service
class O:
- __implements__ = I1
+ implements(I1)
o = O()
request = TestRequest()
@@ -113,7 +113,7 @@
def test_getView_no_view(self):
service = self._service
class O:
- __implements__ = I1
+ implements(I1)
o = O()
request = TestRequest()
@@ -131,7 +131,7 @@
configuration = traverse(configure, '1')
class O:
- __implements__ = I1
+ implements(I1)
configuration.factory = A
@@ -162,7 +162,7 @@
configuration = traverse(configure, '1')
class O:
- __implements__ = I1
+ implements(I1)
o = O()
request = TestRequest()
@@ -186,7 +186,7 @@
class PhonyServiceManager(ServiceManager):
- __implements__ = IServiceService
+ implements(IServiceService)
def resolve(self, name):
if name == 'Foo.Bar.A':