[CMF-checkins] CVS: CMF/CMFCore/tests - test_CatalogTool.py:1.2.26.2 test_ContentTypeRegistry.py:1.8.24.1 test_DiscussionTool.py:1.1.2.2
Yvo Schubbe
schubbe@web.de
Fri, 20 Dec 2002 11:39:40 -0500
Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv21330/CMFCore/tests
Modified Files:
Tag: yuppie-collector096-branch
test_CatalogTool.py test_ContentTypeRegistry.py
test_DiscussionTool.py
Log Message:
more interface cleanups:
- added interface tests and made them pass
=== CMF/CMFCore/tests/test_CatalogTool.py 1.2.26.1 => 1.2.26.2 ===
--- CMF/CMFCore/tests/test_CatalogTool.py:1.2.26.1 Thu Dec 19 17:09:21 2002
+++ CMF/CMFCore/tests/test_CatalogTool.py Fri Dec 20 11:39:39 2002
@@ -10,8 +10,19 @@
from Products.CMFCore.tests.base.dummy import \
DummyContent
+from Products.CMFCore.CatalogTool import IndexableObjectWrapper
from Products.CMFCore.CatalogTool import CatalogTool
+
+class IndexableObjectWrapperTests(TestCase):
+
+ def test_interface(self):
+ from Products.CMFCore.interfaces.portal_catalog \
+ import IndexableObjectWrapper as IIndexableObjectWrapper
+
+ verifyClass(IIndexableObjectWrapper, IndexableObjectWrapper)
+
+
class CatalogToolTests( TestCase ):
def test_processActions( self ):
@@ -37,6 +48,7 @@
def test_suite():
return TestSuite((
+ makeSuite( IndexableObjectWrapperTests ),
makeSuite( CatalogToolTests ),
))
=== CMF/CMFCore/tests/test_ContentTypeRegistry.py 1.8 => 1.8.24.1 ===
--- CMF/CMFCore/tests/test_ContentTypeRegistry.py:1.8 Tue Feb 19 15:43:40 2002
+++ CMF/CMFCore/tests/test_ContentTypeRegistry.py Fri Dec 20 11:39:39 2002
@@ -1,6 +1,11 @@
-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.ContentTypeRegistry import ContentTypeRegistry
from Products.CMFCore.ContentTypeRegistry import MajorMinorPredicate
@@ -42,6 +47,14 @@
assert pred( 'foo', 'text/html', 'asdfljksadf' )
assert not pred( 'foo', 'image/png', 'asdfljksadf' )
+ def test_interface(self):
+ from Products.CMFCore.interfaces.ContentTypeRegistry \
+ import ContentTypeRegistryPredicate \
+ as IContentTypeRegistryPredicate
+
+ verifyClass(IContentTypeRegistryPredicate, MajorMinorPredicate)
+
+
class ExtensionPredicateTests( TestCase ):
def test_empty( self ):
@@ -70,6 +83,14 @@
assert pred( 'foo.htm', 'text/plain', 'asdfljksadf' )
assert not pred( 'foo.bar', 'text/html', 'asdfljksadf' )
+ def test_interface(self):
+ from Products.CMFCore.interfaces.ContentTypeRegistry \
+ import ContentTypeRegistryPredicate \
+ as IContentTypeRegistryPredicate
+
+ verifyClass(IContentTypeRegistryPredicate, ExtensionPredicate)
+
+
class MimeTypeRegexPredicateTests( TestCase ):
def test_empty( self ):
@@ -92,6 +113,14 @@
assert pred( 'foo', 'text/html', 'asdfljksadf' )
assert not pred( 'foo', 'image/png', 'asdfljksadf' )
+ def test_interface(self):
+ from Products.CMFCore.interfaces.ContentTypeRegistry \
+ import ContentTypeRegistryPredicate \
+ as IContentTypeRegistryPredicate
+
+ verifyClass(IContentTypeRegistryPredicate, MimeTypeRegexPredicate)
+
+
class NameRegexPredicateTests( TestCase ):
def test_empty( self ):
@@ -114,6 +143,14 @@
assert pred( 'foo', 'text/plain', 'asdfljksadf' )
assert pred( 'fargo', 'text/plain', 'asdfljksadf' )
assert not pred( 'bar', 'text/plain', 'asdfljksadf' )
+
+ def test_interface(self):
+ from Products.CMFCore.interfaces.ContentTypeRegistry \
+ import ContentTypeRegistryPredicate \
+ as IContentTypeRegistryPredicate
+
+ verifyClass(IContentTypeRegistryPredicate, NameRegexPredicate)
+
class ContentTypeRegistryTests( TestCase ):
@@ -151,6 +188,13 @@
assert not reg.findTypeName( 'bar', 'text/plain', 'asdfljksadf' )
assert reg.findTypeName( 'foo', '', '' ) == 'Foo'
assert reg.findTypeName( 'foo', None, None ) == 'Foo'
+
+ def test_interface(self):
+ from Products.CMFCore.interfaces.ContentTypeRegistry \
+ import ContentTypeRegistry as IContentTypeRegistry
+
+ verifyClass(IContentTypeRegistry, ContentTypeRegistry)
+
def test_suite():
return TestSuite((
=== CMF/CMFCore/tests/test_DiscussionTool.py 1.1.2.1 => 1.1.2.2 ===
--- CMF/CMFCore/tests/test_DiscussionTool.py:1.1.2.1 Thu Dec 19 17:09:44 2002
+++ CMF/CMFCore/tests/test_DiscussionTool.py Fri Dec 20 11:39:39 2002
@@ -8,6 +8,7 @@
from Interface import verify_class_implementation as verifyClass
from Products.CMFCore.DiscussionTool import DiscussionTool
+from Products.CMFCore.DiscussionTool import OldDiscussable
class DiscussionToolTests(TestCase):
@@ -19,9 +20,19 @@
verifyClass(IOldstyleDiscussionTool, DiscussionTool)
+class OldDiscussableTests(TestCase):
+
+ def test_interface(self):
+ from Products.CMFCore.interfaces.Discussions \
+ import OldDiscussable as IOldDiscussable
+
+ verifyClass(IOldDiscussable, OldDiscussable)
+
+
def test_suite():
return TestSuite((
makeSuite( DiscussionToolTests ),
+ makeSuite( OldDiscussableTests ),
))
if __name__ == '__main__':