[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_cachingservice.py:1.9

Steve Alexander steve@cat-box.net
Tue, 3 Jun 2003 10:48:57 -0400


Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv695/src/zope/app/services/tests

Modified Files:
	test_cachingservice.py 
Log Message:
None is not a valid name for an object in a container.
Fixed formatting.


=== Zope3/src/zope/app/services/tests/test_cachingservice.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/services/tests/test_cachingservice.py:1.8	Sun Mar 23 17:35:42 2003
+++ Zope3/src/zope/app/services/tests/test_cachingservice.py	Tue Jun  3 10:48:57 2003
@@ -18,6 +18,7 @@
 
 from unittest import TestCase, TestSuite, main, makeSuite
 from zope.interface.verify import verifyObject
+from zope.interface import implements
 from zope.app.interfaces.cache.cache import ICache
 from zope.app.interfaces.cache.cache import ICachingService
 from zope.app.services.cache import CacheConfiguration
@@ -26,15 +27,13 @@
 from zope.app.services.service import ServiceConfiguration
 from zope.app.traversing import getPath, traverse
 
-
 def sort(list):
     list.sort()
     return list
 
-
 class CacheStub:
 
-    __implements__ = ICache
+    implements(ICache)
 
     def __init__(self, name):
         self.name = name
@@ -64,12 +63,13 @@
         path = getPath(service)
         configuration = ServiceConfiguration("Caching", path)
         configure = default.getConfigurationManager()
-        key = configure.setObject(None, configuration)
+        key = configure.setObject('', configuration)
         traverse(configure, key).status = Active
 
         return service
 
-    def addCache(self, name, cache=None, cname=None, status=Active, folder=''):
+    def addCache(self, name, cache=None, cname=None, status=Active,
+                 folder=''):
         if not cache:
             cache = CacheStub("%s/%s" % (folder, name))
         if not cname:
@@ -79,8 +79,8 @@
         key = default.setObject(cname, cache)
         cache = traverse(default, key)
         configure = default.getConfigurationManager()
-        key = configure.setObject(None, CacheConfiguration(name,
-                                                           getPath(cache)))
+        key = configure.setObject('',
+                                  CacheConfiguration(name, getPath(cache)))
         traverse(configure, key).status = status
         return cache