[CMF-checkins] CVS: CMF - __init__.py:1.1 test_all.py:1.1 test_ContentTypeRegistry.py:1.4 test_PortalFolder.py:1.3 test_DateBound.py:NONE test_DateRange.py:NONE

tseaver@digicool.com tseaver@digicool.com
Fri, 1 Jun 2001 23:45:02 -0400 (EDT)


Update of /cvs-repository/CMF/CMFCore/tests
In directory korak.digicool.com:/tmp/cvs-serv28693

Modified Files:
	test_ContentTypeRegistry.py test_PortalFolder.py 
Added Files:
	__init__.py test_all.py 
Removed Files:
	test_DateBound.py test_DateRange.py 
Log Message:
 - Clean up test suite for CMFCore.


--- Added File __init__.py in package CMF ---
"""\
Unit test package for CMFCore.

As test suites are added, they should be added to the
mega-test-suite in Products.CMFCore.tests.test_all.py
"""

--- Added File test_all.py in package CMF ---
import unittest
from Products.CMFCore.tests import test_ContentTypeRegistry
from Products.CMFCore.tests import test_PortalFolder

def main():
    """\
    Combines all of the test suites in this package into a single
    large test.
    """
    suite = unittest.TestSuite((
        test_ContentTypeRegistry.test_suite(),
        test_PortalFolder.test_suite(),
        ))
    unittest.TextTestRunner().run(suite)

if __name__ == '__main__':
    main()


--- Updated File test_ContentTypeRegistry.py in package CMF --
--- test_ContentTypeRegistry.py	2001/05/26 04:35:53	1.3
+++ test_ContentTypeRegistry.py	2001/06/02 03:45:02	1.4
@@ -122,7 +122,7 @@
         reg = ContentTypeRegistry()
         predIDs = ( 'foo', 'bar', 'baz', 'qux' )
         for predID in predIDs:
-            reg.addPredicate( predID, 'name' )
+            reg.addPredicate( predID, 'name_regex' )
         ids = tuple( map( lambda x: x[0], reg.listPredicates() ) )
         assert ids == predIDs
         reg.reorderPredicate( 'bar', 3 )
@@ -131,7 +131,7 @@
 
     def test_lookup( self ):
         reg = ContentTypeRegistry()
-        reg.addPredicate( 'onlyfoo', 'name' )
+        reg.addPredicate( 'onlyfoo', 'name_regex' )
         reg.getPredicate( 'onlyfoo' ).edit( 'foo' )
         reg.assignTypeName( 'onlyfoo', 'Foo' )
         assert reg.findTypeName( 'foo', 'text/plain', 'asdfljksadf' ) == 'Foo'

--- Updated File test_PortalFolder.py in package CMF --
--- test_PortalFolder.py	2001/06/01 03:51:29	1.2
+++ test_PortalFolder.py	2001/06/02 03:45:02	1.3
@@ -3,6 +3,7 @@
 import re, new
 import OFS.Folder, OFS.SimpleItem
 from AccessControl import SecurityManager
+from Products.CMFCore.TypesTool import TypesTool
 from Products.CMFCore.CatalogTool import CatalogTool
 from Products.CMFCore.PortalContent import PortalContent
 from Products.CMFCore.PortalFolder import *
@@ -108,6 +109,9 @@
         self.root._setObject( 'test', PortalFolder( 'test', '' ) )
         test = self.root.test
 
+        self.root._setObject( 'portal_types', TypesTool() )
+        types_tool = self.root.portal_types
+
         self.root._setObject( 'portal_catalog', CatalogTool() )
         catalog = self.root.portal_catalog
         assert len( catalog ) == 0
@@ -134,6 +138,9 @@
         #
         self.root._setObject( 'test', PortalFolder( 'test', '' ) )
         test = self.root.test
+
+        self.root._setObject( 'portal_types', TypesTool() )
+        types_tool = self.root.portal_types
 
         self.root._setObject( 'portal_catalog', CatalogTool() )
         catalog = self.root.portal_catalog

--- Removed file test_DateBound.py from package CMF --

--- Removed file test_DateRange.py from package CMF --