[CMF-checkins] CVS: CMF/CMFUid/tests - test_uidannotation.py:1.7.4.1 test_uidgeneration.py:1.10.2.1 test_uidhandling.py:1.10.4.1

Tres Seaver tseaver at palladion.com
Fri Jul 15 18:41:55 EDT 2005


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

Modified Files:
      Tag: tseaver-z3_interfaces-branch
	test_uidannotation.py test_uidgeneration.py 
	test_uidhandling.py 
Log Message:


Branch for Z3-ification of CMF interfaces

 - All interfaces declared in the CMF are now Zope3-style interfaces
   (the one remaining exception is to leave Zope2's
   'webdav.WriteLockInterface' declared by CMFCore.PortalContent and
   derivatives.).

TOOD

  - Clean up XXX'es noted during this pass.


=== CMF/CMFUid/tests/test_uidannotation.py 1.7 => 1.7.4.1 ===
--- CMF/CMFUid/tests/test_uidannotation.py:1.7	Wed Jun 15 10:17:40 2005
+++ CMF/CMFUid/tests/test_uidannotation.py	Fri Jul 15 18:41:24 2005
@@ -20,21 +20,16 @@
 import Zope2
 Zope2.startup()
 
-from Interface.Verify import verifyObject
 
-from Products.CMFCore.PortalFolder import PortalFolder
-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
-
 
 UID_ATTRNAME = 'cmf_uid'
 
 class UniqueIdAnnotationTests(SecurityTest):
 
     def setUp(self):
+        from Products.CMFCore.tests.base.dummy import DummyContent
         from Products.CMFUid.UniqueIdAnnotationTool \
                 import UniqueIdAnnotationTool
 
@@ -43,6 +38,10 @@
         self.root._setObject('dummy', DummyContent(id='dummy'))
 
     def test_interface(self):
+        from zope.interface.verify import verifyObject
+        from Products.CMFUid.interfaces import IUniqueIdAnnotation
+        from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement
+
         dummy = self.root.dummy
         anno_tool = self.root.portal_uidannotation
         annotation = anno_tool(dummy, UID_ATTRNAME)
@@ -121,6 +120,9 @@
         self.assertEqual(getattr(dummy, UID_ATTRNAME), annotation)
 
     def test_simulateNestedFolderCloneRemovingUid1(self):
+        from Products.CMFCore.PortalFolder import PortalFolder
+        from Products.CMFCore.tests.base.dummy import DummyContent
+
         self.root._setObject( 'foo', PortalFolder(id='foo') )
         foo = self.root.foo
         foo._setObject( 'sub1', PortalFolder(id='sub1') )


=== CMF/CMFUid/tests/test_uidgeneration.py 1.10 => 1.10.2.1 ===
--- CMF/CMFUid/tests/test_uidgeneration.py:1.10	Thu Jul 14 06:44:50 2005
+++ CMF/CMFUid/tests/test_uidgeneration.py	Fri Jul 15 18:41:24 2005
@@ -20,24 +20,18 @@
 import Zope2
 Zope2.startup()
 
-from BTrees.Length import Length
-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 IUniqueIdGenerator
-from Products.CMFUid.UniqueIdGeneratorTool import UniqueIdGeneratorTool
-
-
 class UniqueIdGeneratorTests(SecurityTest):
 
     def setUp(self):
+        from Products.CMFUid.UniqueIdGeneratorTool import UniqueIdGeneratorTool
         SecurityTest.setUp(self)
         self.root._setObject('portal_uidgenerator', UniqueIdGeneratorTool())
     
     def test_interface(self):
+        from zope.interface.verify import verifyObject
+        from Products.CMFUid.interfaces import IUniqueIdGenerator
         generator = self.root.portal_uidgenerator
         verifyObject(IUniqueIdGenerator, generator)
         
@@ -56,6 +50,7 @@
         self.assertEqual(result, uid)
 
     def test_migrationFromBTreeLengthToInteger(self):
+        from BTrees.Length import Length
         # For backwards compatibility with CMF 1.5.0 and 1.5.1, check if
         # the generator correctly replaces a ``BTree.Length.Length`` object
         # to an integer.


=== CMF/CMFUid/tests/test_uidhandling.py 1.10 => 1.10.4.1 ===
--- CMF/CMFUid/tests/test_uidhandling.py:1.10	Wed Jun 15 10:17:40 2005
+++ CMF/CMFUid/tests/test_uidhandling.py	Fri Jul 15 18:41:24 2005
@@ -20,24 +20,9 @@
 import Zope2
 Zope2.startup()
 
-from Interface.Verify import verifyObject
 
 from Products.CMFCore.tests.base.testcase import SecurityTest
 
-from Products.CMFCore.tests.base.dummy import DummyContent
-from Products.CMFCore.tests.base.dummy import DummyFolder
-from Products.CMFCore.tests.base.dummy import DummySite
-
-from Products.CMFCore.CatalogTool import CatalogTool
-
-from Products.CMFUid.interfaces import IUniqueIdHandler
-from Products.CMFUid.interfaces import IUniqueIdBrainQuery
-from Products.CMFUid.interfaces import IUniqueIdUnrestrictedQuery
-
-from Products.CMFUid.UniqueIdGeneratorTool import UniqueIdGeneratorTool
-from Products.CMFUid.UniqueIdAnnotationTool import UniqueIdAnnotationTool
-from Products.CMFUid.UniqueIdHandlerTool import UniqueIdHandlerTool
-
 def removeUnnecessaryIndexes(catalog):
     indexes = [id[0] for id in catalog.enumerateIndexes()]
     columns = catalog.enumerateColumns()
@@ -52,6 +37,14 @@
 class UniqueIdHandlerTests(SecurityTest):
 
     def setUp(self):
+        from Products.CMFCore.tests.base.dummy import DummyContent
+        from Products.CMFCore.CatalogTool import CatalogTool
+        from Products.CMFUid.UniqueIdGeneratorTool \
+            import UniqueIdGeneratorTool
+        from Products.CMFUid.UniqueIdAnnotationTool \
+            import UniqueIdAnnotationTool
+        from Products.CMFUid.UniqueIdHandlerTool \
+            import UniqueIdHandlerTool
         SecurityTest.setUp(self)
         self.root._setObject('portal_catalog', CatalogTool())
         self.root._setObject('portal_uidgenerator', UniqueIdGeneratorTool())
@@ -63,6 +56,11 @@
         removeUnnecessaryIndexes(self.root.portal_catalog)
     
     def test_interface(self):
+        from zope.interface.verify import verifyObject
+        from Products.CMFUid.interfaces import IUniqueIdHandler
+        from Products.CMFUid.interfaces import IUniqueIdBrainQuery
+        from Products.CMFUid.interfaces import IUniqueIdUnrestrictedQuery
+
         handler = self.root.portal_uidhandler
         verifyObject(IUniqueIdHandler, handler)
         verifyObject(IUniqueIdBrainQuery, handler)



More information about the CMF-checkins mailing list