[CMF-checkins] CVS: Products/CMFCore/tests -
test_CMFBTreeFolder.py:1.2
Tres Seaver
tseaver at palladion.com
Tue Jul 12 22:41:48 EDT 2005
Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv18271/CMFCore/tests
Added Files:
test_CMFBTreeFolder.py
Log Message:
- Forward-port addition of CMFBTreeFolder from 1.5 branch.
=== Products/CMFCore/tests/test_CMFBTreeFolder.py 1.1 => 1.2 ===
--- /dev/null Tue Jul 12 22:41:47 2005
+++ Products/CMFCore/tests/test_CMFBTreeFolder.py Tue Jul 12 22:41:47 2005
@@ -0,0 +1,46 @@
+""" Unit test for CMFBTreeFolder
+
+$Id$
+"""
+
+import unittest
+
+class CMFBTreeFolderTests(unittest.TestCase):
+
+ def _getTargetClass(self):
+
+ from Products.CMFCore.CMFBTreeFolder import CMFBTreeFolder
+ return CMFBTreeFolder
+
+ def _makeOne( self, id='test', *args, **kw ):
+
+ return self._getTargetClass()( id, *args, **kw )
+
+ def test_empty( self ):
+
+ empty = self._makeOne()
+ self.assertEqual( len( empty.objectIds() ), 0 )
+
+ def test___module_aliases__( self ):
+
+ # This test will *fail* on Zope 2.8.0, because it (erroneously)
+ # included CMFBTreeFolder in the core BTreeFolder2 product.
+ from Products.BTreeFolder2.CMFBTreeFolder \
+ import CMFBTreeFolder as BBB
+
+ self.failUnless( BBB is self._getTargetClass() )
+
+
+def test_suite():
+ suite = unittest.TestSuite()
+ # Don't test CMFBTreeFolder unless the underlying support is present.
+ try:
+ import Products.BTreeFolder2
+ except ImportError:
+ pass
+ else:
+ suite.addTest( unittest.makeSuite( CMFBTreeFolderTests ) )
+ return suite
+
+if __name__ == '__main__':
+ unittest.main( defaultTest='test_suite' )
More information about the CMF-checkins
mailing list