[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/CachingService/tests - testCachingService.py:1.5

Marius Gedminas mgedmin@codeworks.lt
Wed, 11 Dec 2002 04:04:09 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/CachingService/tests
In directory cvs.zope.org:/tmp/cvs-serv31269/lib/python/Zope/App/OFS/Services/CachingService/tests

Modified Files:
	testCachingService.py 
Log Message:
Eliminate strange for loops in unit tests


=== Zope3/lib/python/Zope/App/OFS/Services/CachingService/tests/testCachingService.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/App/OFS/Services/CachingService/tests/testCachingService.py:1.4	Fri Dec  6 13:03:31 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/CachingService/tests/testCachingService.py	Wed Dec 11 04:04:08 2002
@@ -70,15 +70,9 @@
         configuration = ServiceConfiguration("CachingService", path)
 
         configure = traverse(default, 'configure')
-        configure.setObject("myCachingServiceDir", configuration)
-
-        # XXX: This can't be the easiest way to activate the service!
-        for i in range(1, 100):
-            c = traverse(configure, str(i))
-            if c == configuration:
-                break
-
-        c.status = Active
+        configure = traverse(default, 'configure')
+        key = configure.setObject("myCachingServiceDir", configuration)
+        traverse(configure, key).status = Active
 
 
 class TestCachingService(CachingServiceSetup, TestCase):