[Zope3-checkins] CVS: Zope3/src/zope/app/cache/tests - test_annotationcacheable.py:1.7.18.1 test_cachename.py:1.3.10.1 test_caching.py:1.7.18.1 test_ramcache.py:1.7.10.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:24:27 -0400
Update of /cvs-repository/Zope3/src/zope/app/cache/tests
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/app/cache/tests
Modified Files:
Tag: cw-mail-branch
test_annotationcacheable.py test_cachename.py test_caching.py
test_ramcache.py
Log Message:
Synced up with HEAD
=== Zope3/src/zope/app/cache/tests/test_annotationcacheable.py 1.7 => 1.7.18.1 ===
--- Zope3/src/zope/app/cache/tests/test_annotationcacheable.py:1.7 Tue Mar 11 11:10:56 2003
+++ Zope3/src/zope/app/cache/tests/test_annotationcacheable.py Sun Jun 22 10:22:53 2003
@@ -27,9 +27,10 @@
from zope.app.interfaces.cache.cache import ICachingService
from zope.component.service import serviceManager as sm
from zope.app.interfaces.services.service import ISimpleService
+from zope.interface import implements
class ObjectStub:
- __implements__ = IAttributeAnnotatable
+ implements(IAttributeAnnotatable)
class CacheStub:
@@ -41,7 +42,7 @@
class CachingServiceStub:
- __implements__ = ICachingService, ISimpleService
+ implements(ICachingService, ISimpleService)
def __init__(self):
self.caches = {}
=== Zope3/src/zope/app/cache/tests/test_cachename.py 1.3 => 1.3.10.1 ===
--- Zope3/src/zope/app/cache/tests/test_cachename.py:1.3 Thu May 1 15:35:06 2003
+++ Zope3/src/zope/app/cache/tests/test_cachename.py Sun Jun 22 10:22:53 2003
@@ -22,22 +22,29 @@
from zope.app.interfaces.cache.cache import CacheName
from zope.app.services.tests.placefulsetup import PlacefulSetup
-from zope.app.services.tests.servicemanager import TestingServiceManager
+from zope.app.tests import setup
+from zope.app.interfaces.services.service import ILocalService
+from zope.app.interfaces.annotation import IAttributeAnnotatable
+from zope.interface import implements
-class CachingServiceStub(object):
+__metaclass__ = type
+
+class CachingServiceStub:
+
+ implements(ILocalService, IAttributeAnnotatable)
def getAvailableCaches(self):
return 'foo', 'bar', 'baz'
+ # IAttributeAnnotatable is implemented so that there will be an
+ # IDependable adapter available.
class CacheNameTest(PlacefulSetup, unittest.TestCase):
def setUp(self):
- PlacefulSetup.setUp(self)
- self.buildFolders()
- sm = TestingServiceManager()
- self.rootFolder.setServiceManager(sm)
- sm.Caching = CachingServiceStub()
+ PlacefulSetup.setUp(self, folders=True)
+ sm = self.makeSite()
+ setup.addService(sm, 'Caching', CachingServiceStub())
def test(self):
field = CacheName().bind(self.rootFolder)
=== Zope3/src/zope/app/cache/tests/test_caching.py 1.7 => 1.7.18.1 ===
--- Zope3/src/zope/app/cache/tests/test_caching.py:1.7 Tue Mar 11 11:10:56 2003
+++ Zope3/src/zope/app/cache/tests/test_caching.py Sun Jun 22 10:22:53 2003
@@ -31,16 +31,17 @@
from zope.app.tests.placelesssetup import PlacelessSetup
from zope.component.service import serviceManager as sm
from zope.app.interfaces.services.service import ISimpleService
+from zope.interface import implements
class ObjectStub:
- __implements__ = IAttributeAnnotatable
+ implements(IAttributeAnnotatable)
class CacheStub:
pass
class CachingServiceStub:
- __implements__ = ICachingService, ISimpleService
+ implements(ICachingService, ISimpleService)
def __init__(self):
self.caches = {}
=== Zope3/src/zope/app/cache/tests/test_ramcache.py 1.7 => 1.7.10.1 ===
--- Zope3/src/zope/app/cache/tests/test_ramcache.py:1.7 Thu May 1 15:35:06 2003
+++ Zope3/src/zope/app/cache/tests/test_ramcache.py Sun Jun 22 10:22:53 2003
@@ -21,11 +21,12 @@
from zope.app.tests.placelesssetup import PlacelessSetup
from zope.app.interfaces.traversing import IPhysicallyLocatable
from zope.interface.verify import verifyClass, verifyObject
+from zope.interface import implements
from time import time
class Locatable:
- __implements__ = IPhysicallyLocatable
+ implements(IPhysicallyLocatable)
def __init__(self, path=('a', 'b')):
self.path = path
@@ -204,7 +205,7 @@
from zope.app.interfaces.event import IEvent
class DummyEvent:
- __implements__ = IEvent
+ implements(IEvent)
location = ('aaa',)
ob = Locatable(path=location)