[CMF-checkins] CVS: CMF/CMFUid/tests - test_uidannotation.py:1.3 test_uidgeneration.py:1.5 test_uidhandling.py:1.5

Grégoire Weber zope.org at incept.ch
Thu Jul 22 18:45:44 EDT 2004


Update of /cvs-repository/CMF/CMFUid/tests
In directory cvs.zope.org:/tmp/cvs-serv29305/tests

Modified Files:
	test_uidannotation.py test_uidgeneration.py 
	test_uidhandling.py 
Log Message:
- forgot to update interface after previous rfactoring, tests now use verifyObject to avoid mistakes of this type in the future
- added interface for uid annotation management


=== CMF/CMFUid/tests/test_uidannotation.py 1.2 => 1.3 ===
--- CMF/CMFUid/tests/test_uidannotation.py:1.2	Thu Jul 22 10:15:03 2004
+++ CMF/CMFUid/tests/test_uidannotation.py	Thu Jul 22 18:45:43 2004
@@ -21,17 +21,20 @@
 import Zope
 Zope.startup()
 
+from Interface.Verify import verifyObject
+
 from Products.CMFCore.tests.base.dummy import DummyContent
 
 from Products.CMFCore.tests.base.testcase import SecurityTest
 
 from Products.CMFUid.interfaces import IUniqueIdAnnotation
+from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement
 from Products.CMFUid.UniqueIdAnnotationTool import UniqueIdAnnotationTool
 
 
 UID_ATTRNAME = 'cmf_uid'
 
-class UniqueIdGeneratorTests(SecurityTest):
+class UniqueIdAnnotationTests(SecurityTest):
 
     def setUp(self):
         SecurityTest.setUp(self)
@@ -40,9 +43,11 @@
     
     def test_interface(self):
         dummy = self.root.dummy
-        annotation = self.root.portal_uidannotation(dummy, UID_ATTRNAME)
+        anno_tool = self.root.portal_uidannotation
+        annotation = anno_tool(dummy, UID_ATTRNAME)
         
-        IUniqueIdAnnotation.isImplementedBy(annotation)
+        verifyObject(IUniqueIdAnnotationManagement, anno_tool)
+        verifyObject(IUniqueIdAnnotation, annotation)
         
     def test_setAndGetUid(self):
         dummy = self.root.dummy
@@ -117,7 +122,7 @@
 
 def test_suite():
     return TestSuite((
-        makeSuite(UniqueIdGeneratorTests),
+        makeSuite(UniqueIdAnnotationTests),
         ))
 
 if __name__ == '__main__':


=== CMF/CMFUid/tests/test_uidgeneration.py 1.4 => 1.5 ===
--- CMF/CMFUid/tests/test_uidgeneration.py:1.4	Thu Jul 22 09:43:37 2004
+++ CMF/CMFUid/tests/test_uidgeneration.py	Thu Jul 22 18:45:43 2004
@@ -21,6 +21,8 @@
 import Zope
 Zope.startup()
 
+from Interface.Verify import verifyObject
+
 from Products.CMFCore.tests.base.dummy import DummyContent
 
 from Products.CMFCore.tests.base.testcase import SecurityTest
@@ -37,7 +39,7 @@
     
     def test_interface(self):
         generator = self.root.portal_uidgenerator
-        IUniqueIdGenerator.isImplementedBy(generator)
+        verifyObject(IUniqueIdGenerator, generator)
         
     def test_returnedUidsAreValidAndDifferent(self):
         generator = self.root.portal_uidgenerator


=== CMF/CMFUid/tests/test_uidhandling.py 1.4 => 1.5 ===
--- CMF/CMFUid/tests/test_uidhandling.py:1.4	Thu Jul 22 09:44:37 2004
+++ CMF/CMFUid/tests/test_uidhandling.py	Thu Jul 22 18:45:43 2004
@@ -21,6 +21,8 @@
 import Zope
 Zope.startup()
 
+from Interface.Verify import verifyObject
+
 from Products.CMFCore.tests.base.testcase import SecurityTest
 
 from Products.CMFCore.tests.base.dummy import DummyContent
@@ -54,7 +56,7 @@
     
     def test_interface(self):
         handler = self.root.portal_uidhandler
-        IUniqueIdHandler.isImplementedBy(handler)
+        verifyObject(IUniqueIdHandler, handler)
     
     def test_getUidOfNotYetRegisteredObject(self):
         handler = self.root.portal_uidhandler



More information about the CMF-checkins mailing list