[CMF-checkins] CVS: CMF/CMFCore/tests - test_CatalogTool.py:1.2.26.1 test_TypesTool.py:1.17.12.1 test_all.py:1.20.2.2

Yvo Schubbe schubbe@web.de
Thu, 19 Dec 2002 17:09:21 -0500


Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv8472/CMFCore/tests

Modified Files:
      Tag: yuppie-collector096-branch
	test_CatalogTool.py test_TypesTool.py test_all.py 
Log Message:
tool interface cleanup:
- added interface tests and made them pass

=== CMF/CMFCore/tests/test_CatalogTool.py 1.2 => 1.2.26.1 ===
--- CMF/CMFCore/tests/test_CatalogTool.py:1.2	Fri Feb 15 14:45:33 2002
+++ CMF/CMFCore/tests/test_CatalogTool.py	Thu Dec 19 17:09:21 2002
@@ -1,6 +1,12 @@
-import Zope
 from unittest import TestCase, TestSuite, makeSuite, main
 
+import Zope
+try:
+    from Interface.Verify import verifyClass
+except ImportError:
+    # for Zope versions before 2.6.0
+    from Interface import verify_class_implementation as verifyClass
+
 from Products.CMFCore.tests.base.dummy import \
      DummyContent
 
@@ -18,6 +24,16 @@
 
         tool.catalog_object( dummy, '/dummy' )
         tool.catalog_object( dummy, '/dummy', [ 'SearchableText' ] )
+
+    def test_interface(self):
+        from Products.CMFCore.interfaces.portal_catalog \
+                import portal_catalog as ICatalogTool
+        from Products.CMFCore.interfaces.portal_actions \
+                import ActionProvider as IActionProvider
+
+        verifyClass(ICatalogTool, CatalogTool)
+        verifyClass(IActionProvider, CatalogTool)
+
 
 def test_suite():
     return TestSuite((


=== CMF/CMFCore/tests/test_TypesTool.py 1.17 => 1.17.12.1 ===
--- CMF/CMFCore/tests/test_TypesTool.py:1.17	Sun Aug  4 18:59:12 2002
+++ CMF/CMFCore/tests/test_TypesTool.py	Thu Dec 19 17:09:21 2002
@@ -1,6 +1,12 @@
-import Zope
 from unittest import TestCase, TestSuite, makeSuite, main
 
+import Zope
+try:
+    from Interface.Verify import verifyClass
+except ImportError:
+    # for Zope versions before 2.6.0
+    from Interface import verify_class_implementation as verifyClass
+
 from Products.CMFCore.TypesTool import\
      FactoryTypeInformation as FTI,\
      ScriptableTypeInformation as STI,\
@@ -77,6 +83,16 @@
         self.failUnless(meta_types.has_key('Scriptable Type Information'))
         self.failUnless(meta_types.has_key('Factory-based Type Information'))
 
+    def test_interface(self):
+        from Products.CMFCore.interfaces.portal_types \
+                import portal_types as ITypesTool
+        from Products.CMFCore.interfaces.portal_actions \
+                import ActionProvider as IActionProvider
+
+        verifyClass(ITypesTool, TypesTool)
+        verifyClass(IActionProvider, TypesTool)
+
+
 class TypeInfoTests( TestCase ):
     
     def test_construction( self ):
@@ -231,7 +247,7 @@
         
         action = ti.getActionById( 'slot' )
         self.assertEqual( action, 'foo_slot' )
-        
+
 
 class FTIDataTests( TypeInfoTests ):
 
@@ -250,6 +266,12 @@
         self.assertEqual( ti.product, 'FooProduct' )
         self.assertEqual( ti.factory, 'addFoo' )
 
+    def test_interface(self):
+        from Products.CMFCore.interfaces.portal_types \
+                import ContentTypeInformation as ITypeInformation
+
+        verifyClass(ITypeInformation, FTI)
+        
 
 class STIDataTests( TypeInfoTests ):
 
@@ -267,6 +289,13 @@
                                )
         self.assertEqual( ti.permission, 'Add Foos' )
         self.assertEqual( ti.constructor_path, 'foo_add' )
+
+    def test_interface(self):
+        from Products.CMFCore.interfaces.portal_types \
+                import ContentTypeInformation as ITypeInformation
+
+        verifyClass(ITypeInformation, STI)
+        
 
 class FTIConstructionTests( TestCase ):
 


=== CMF/CMFCore/tests/test_all.py 1.20.2.1 => 1.20.2.2 ===
--- CMF/CMFCore/tests/test_all.py:1.20.2.1	Thu Dec 19 13:20:38 2002
+++ CMF/CMFCore/tests/test_all.py	Thu Dec 19 17:09:21 2002
@@ -21,9 +21,12 @@
         'test_FSImage',
         'test_CachingPolicyManager',
         'test_FSSecurity',
+        'test_DiscussionTool',
         'test_MemberDataTool',
         'test_MembershipTool',
         'test_RegistrationTool',
+        'test_SkinsTool',
+        'test_UndoTool',
         'test_URLTool',
         ])