[CMF-checkins] CVS: Products/CMFCore/tests - test_OpaqueItems.py:1.8

Grégoire Weber zope.org at incept.ch
Mon Jul 19 18:40:32 EDT 2004


Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv1146/tests

Modified Files:
	test_OpaqueItems.py 
Log Message:
- replaced old fashioned and not unicode aware 'type(x) is StringType' by 'isinstance(x, basestring)'
- some unimportant renamings


=== Products/CMFCore/tests/test_OpaqueItems.py 1.7 => 1.8 ===
--- Products/CMFCore/tests/test_OpaqueItems.py:1.7	Mon Jul 19 10:51:52 2004
+++ Products/CMFCore/tests/test_OpaqueItems.py	Mon Jul 19 18:40:32 2004
@@ -4,8 +4,6 @@
 Zope.startup()
 from Interface.Verify import verifyClass
 
-from types import StringType
-
 from Products.CMFCore.interfaces.IOpaqueItems \
     import ICallableOpaqueItem, ICallableOpaqueItemEvents
 from Products.CMFCore.PortalFolder import PortalFolder
@@ -36,8 +34,8 @@
         if opaqueItem is None:
             self.opaqueItem = 'noncallable'
             self.opaqueItemsId = 'opaqueItem'
-        elif type(opaqueItem) is StringType:
-            setattr(self, opaqueItem, HooksOnly(opaqueItem))
+        elif isinstance(opaqueItem, basestring):
+            setattr(self, opaqueItem, Hooks(opaqueItem))
             self.opaqueItemsId = opaqueItem
         else:
             self.opaqueItem = opaqueItem('opaqueItem')
@@ -73,14 +71,14 @@
     def getId(self):
         return self.id
 
-class MarkerOnly(OpaqueBase):
+class Marker(OpaqueBase):
     """ Opaque item without manage_after/before hookes but marked as callable
     """
     __implements__ = (
         ICallableOpaqueItem,
     )
 
-class HooksOnly(OpaqueBase):
+class Hooks(OpaqueBase):
     """ Opaque item with manage_after/before hooks but not marked as callable
     """
     __implements__ = (
@@ -100,10 +98,10 @@
         self.deleteCounter += 1
 
 
-class HooksAndMarker(HooksOnly, MarkerOnly):
+class MarkerAndHooks(Marker, Hooks):
     """ Opaque item with manage_after/before hookes and marked as callable
     """
-    __implements__ = HooksOnly.__implements__ + MarkerOnly.__implements__
+    __implements__ = Marker.__implements__ + Hooks.__implements__
 
 
 # -------------------------------------------
@@ -159,7 +157,7 @@
     def test_callableItemWithMarkerOnly(self):
         folder = self.folder
         sub = self.sub
-        dummy = addDummyContent(folder, 'dummy', MarkerOnly)
+        dummy = addDummyContent(folder, 'dummy', Marker)
 
         self.failIf(dummy.isNotifiedByAfterAdd())
         self.failIf(dummy.isNotifiedByAfterClone())
@@ -180,7 +178,7 @@
     def test_callableItemWithHooksOnly(self):
         folder = self.folder
         sub = self.sub
-        dummy = addDummyContent(folder, 'dummy', HooksOnly)
+        dummy = addDummyContent(folder, 'dummy', Hooks)
 
         self.failIf(dummy.isNotifiedByAfterAdd())
         self.failIf(dummy.isNotifiedByAfterClone())
@@ -198,10 +196,10 @@
         self.failIf(dummy.isNotifiedByAfterClone())
         self.failIf(dummy.isNotifiedByBeforeDelete())
 
-    def test_callableItemWithHooksAndMarker(self):
+    def test_callableItemWithMarkerAndHooks(self):
         folder = self.folder
         sub = self.sub
-        dummy = addDummyContent(folder, 'dummy', HooksAndMarker)
+        dummy = addDummyContent(folder, 'dummy', MarkerAndHooks)
 
         self.assertEqual(dummy.isNotifiedByAfterAdd(), 1)
         self.failIf(dummy.isNotifiedByAfterClone())



More information about the CMF-checkins mailing list