[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Caching/tests - testAnnotationCacheable.py:1.5 testICache.py:1.5

Barry Warsaw barry@wooz.org
Fri, 20 Dec 2002 14:35:12 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Caching/tests
In directory cvs.zope.org:/tmp/cvs-serv11652/lib/python/Zope/App/Caching/tests

Modified Files:
	testAnnotationCacheable.py testICache.py 
Log Message:
test module cleanups:

- no docstrings in test methods (convert to comments)
- whitespace normalization
- other minor cleanups


=== Zope3/lib/python/Zope/App/Caching/tests/testAnnotationCacheable.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/App/Caching/tests/testAnnotationCacheable.py:1.4	Wed Oct  9 09:08:44 2002
+++ Zope3/lib/python/Zope/App/Caching/tests/testAnnotationCacheable.py	Fri Dec 20 14:34:41 2002
@@ -30,16 +30,16 @@
 class ObjectStub:
     __implements__ = IAttributeAnnotatable
 
-class CacheStub:
 
+class CacheStub:
     def __init__(self):
         self.invalidated = []
 
     def invalidate(self, obj):
         self.invalidated.append(obj)
 
-class CachingServiceStub:
 
+class CachingServiceStub:
     __implements__ = ICachingService
 
     def __init__(self):
@@ -48,8 +48,8 @@
     def getCache(self, name):
         return self.caches[name]
 
-class TestAnnotationCacheable(PlacelessSetup, TestCase):
 
+class TestAnnotationCacheable(PlacelessSetup, TestCase):
     def setUp(self):
         PlacelessSetup.setUp(self)
         getService(None, "Adapters").provideAdapter(
@@ -70,25 +70,28 @@
                           "failed to set cache ID")
 
     def testInvalidate(self):
-        """Test that setting a different cache ID invalidates the old
-        cached value"""
+        # Test that setting a different cache ID invalidates the old cached
+        # value
         self.service.caches['cache1'] = cache1 = CacheStub()
         self.service.caches['cache2'] = cache2 = CacheStub()
         ob = ObjectStub()
         adapter = AnnotationCacheable(ob)
         adapter.setCacheId('cache1')
-        self.assertEquals(cache1.invalidated, [], "called invalidate too early")
+        self.assertEquals(cache1.invalidated, [],
+                          "called invalidate too early")
         adapter.setCacheId('cache2')
         self.assertEquals(cache1.invalidated, [ob], "did not call invalidate")
         adapter.setCacheId('cache2')
-        self.assertEquals(cache2.invalidated, [],
-                          "called invalidate when reassigning to the same cache")
-                
+        self.assertEquals(
+            cache2.invalidated, [],
+            "called invalidate when reassigning to the same cache")
+
 
 def test_suite():
-    return TestSuite((
-        makeSuite(TestAnnotationCacheable),
-        ))
+    suite = TestSuite()
+    suite.addTest(makeSuite(TestAnnotationCacheable))
+    return suite
+
 
-if __name__=='__main__':
+if __name__ == '__main__':
     main(defaultTest='test_suite')


=== Zope3/lib/python/Zope/App/Caching/tests/testICache.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/App/Caching/tests/testICache.py:1.4	Thu Dec 12 10:28:16 2002
+++ Zope3/lib/python/Zope/App/Caching/tests/testICache.py	Fri Dec 20 14:34:41 2002
@@ -27,11 +27,11 @@
     """
 
     def testVerifyICache(self):
-        """Verify that the object implements ICache"""
+        # Verify that the object implements ICache
         verifyObject(ICache, self._Test__new())
 
     def testCaching(self):
-        """Verify basic caching"""
+        # Verify basic caching
         cache = self._Test__new()
         ob = "obj"
         data = "data"