[CMF-checkins] CVS: Products/CMFCore/tests -
test_CMFBTreeFolder.py:1.1.2.1
Tres Seaver
tseaver at palladion.com
Tue Jul 12 22:31:02 EDT 2005
Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv15074/CMFCore/tests
Added Files:
Tag: CMF-1_5-branch
test_CMFBTreeFolder.py
Log Message:
- CMFCore/CMFBTreeFolder.py: Moved here from Zope core's
Products/BTreeFolder2; conditional import, with module alias, into
__init__.py, for compatibility with Zope 2.7; 2.8.0 has BTreeFolder2
in the core (see http://www.zope.org/Collectors/Zope/1813).
=== Added File Products/CMFCore/tests/test_CMFBTreeFolder.py ===
""" Unit test for CMFBTreeFolder
$Id: test_CMFBTreeFolder.py,v 1.1.2.1 2005/07/13 02:31:01 tseaver Exp $
"""
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