Back to index

plone3  3.1.7
test_CMFBTreeFolder.py
Go to the documentation of this file.
00001 ##############################################################################
00002 #
00003 # Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
00004 #
00005 # This software is subject to the provisions of the Zope Public License,
00006 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
00007 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00008 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00009 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00010 # FOR A PARTICULAR PURPOSE.
00011 #
00012 ##############################################################################
00013 """ Unit tests for CMFBTreeFolder module.
00014 
00015 $Id: test_CMFBTreeFolder.py 68496 2006-06-05 16:30:18Z yuppie $
00016 """
00017 
00018 import unittest
00019 import Testing
00020 
00021 from Products.CMFCore.testing import ConformsToFolder
00022 
00023 
00024 class CMFBTreeFolderTests(ConformsToFolder, unittest.TestCase):
00025 
00026     def _getTargetClass(self):
00027         from Products.CMFCore.CMFBTreeFolder import CMFBTreeFolder
00028 
00029         return CMFBTreeFolder
00030 
00031     def _makeOne(self, *args, **kw):
00032         return self._getTargetClass()(*args, **kw)
00033 
00034     def test_empty( self ):
00035         empty = self._makeOne('test')
00036         self.assertEqual( len( empty.objectIds() ), 0 )
00037 
00038 # this test doesn't work with ZopeTestCase.ZopeLite.installProduct
00039 ##    def test___module_aliases__( self ):
00040 ##        from Products.BTreeFolder2.CMFBTreeFolder \
00041 ##            import CMFBTreeFolder as BBB
00042 ##
00043 ##        self.failUnless( BBB is self._getTargetClass() )
00044 
00045 
00046 def test_suite():
00047     return unittest.TestSuite((
00048         unittest.makeSuite(CMFBTreeFolderTests),
00049         ))
00050 
00051 if __name__ == '__main__':
00052     unittest.main(defaultTest='test_suite')