[CMF-checkins] CVS: CMF/CMFCore/tests - test_CatalogTool.py:1.1.28.1
Chris Withers
chrisw@nipltd.com
Fri, 15 Feb 2002 11:37:03 -0500
Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv29036
Modified Files:
Tag: ChrisW-refactor_tests-branch
test_CatalogTool.py
Log Message:
Done CatalogTool
=== CMF/CMFCore/tests/test_CatalogTool.py 1.1 => 1.1.28.1 ===
-import unittest
-import OFS.Folder, OFS.SimpleItem
-import Acquisition
-from Products.CMFCore.CatalogTool import *
-from Products.CMFCore.PortalContent import PortalContent
-
-
-class DummyContent( PortalContent, OFS.SimpleItem.Item ):
- """
- """
- meta_type = 'Dummy'
-
-class CatalogToolTests( unittest.TestCase ):
-
- def setUp( self ):
- get_transaction().begin()
-
- def tearDown( self ):
- get_transaction().abort()
+from unittest import TestCase, TestSuite, makeSuite, main
+
+from Products.CMFCore.tests.base.dummy import \
+ DummyContent
+
+from Products.CMFCore.CatalogTool import CatalogTool
+
+class CatalogToolTests( TestCase ):
def test_processActions( self ):
"""
@@ -25,18 +14,15 @@
argument, 'idxs', to 'catalog_object'.
"""
tool = CatalogTool()
- dummy = DummyContent()
+ dummy = DummyContent(catalog=1)
tool.catalog_object( dummy, '/dummy' )
tool.catalog_object( dummy, '/dummy', [ 'SearchableText' ] )
def test_suite():
- suite = unittest.TestSuite()
- suite.addTest( unittest.makeSuite( CatalogToolTests ) )
- return suite
-
-def run():
- unittest.TextTestRunner().run(test_suite())
+ return TestSuite((
+ makeSuite( CatalogToolTests ),
+ ))
if __name__ == '__main__':
- run()
+ main(defaultTest='test_suite')