[CMF-checkins] CVS: CMF/CMFSetup/tests - test_actions.py:1.11
Yvo Schubbe
y.2005- at wcm-solutions.de
Tue Jan 25 14:50:13 EST 2005
Update of /cvs-repository/CMF/CMFSetup/tests
In directory cvs.zope.org:/tmp/cvs-serv24836/CMFSetup/tests
Modified Files:
test_actions.py
Log Message:
merged yuppie-new_actions-branch:
- added ActionCategory and Action interfaces
- added ActionCategory and Action classes
- modified ActionsTool to make use of these new classes
- removed deprecated 'name' and 'permissions' keys from ActionInfo
- allowed 'description' key in ActionInfo
- implemented IAction in the oldstyle ActionInformation class and used this interface to simplify ActionInfo
- updated setup handlers, tests, default profile and skins
- fixed ActionInfo issue regarding permissions in oldstyle action dicts
=== CMF/CMFSetup/tests/test_actions.py 1.10 => 1.11 ===
--- CMF/CMFSetup/tests/test_actions.py:1.10 Tue Dec 14 15:56:58 2004
+++ CMF/CMFSetup/tests/test_actions.py Tue Jan 25 14:49:42 2005
@@ -23,6 +23,7 @@
from Acquisition import Implicit
from Acquisition import aq_parent
from OFS.Folder import Folder
+from OFS.OrderedFolder import OrderedFolder
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.interfaces.portal_actions \
import ActionProvider as IActionProvider
@@ -32,7 +33,7 @@
from common import DummyImportContext
-class DummyTool( Folder, ActionProviderBase ):
+class DummyTool( OrderedFolder, ActionProviderBase ):
__implements__ = ( IActionProvider, )
@@ -177,6 +178,7 @@
configurator = self._makeOne( site )
tool_info = configurator.parseXML( _EMPTY_EXPORT )
+ self.assertEqual( len(tool_info), 2 )
self.assertEqual( len( tool_info[ 'providers' ] ), 1 )
@@ -190,6 +192,7 @@
configurator = self._makeOne( site )
tool_info = configurator.parseXML( _NORMAL_EXPORT )
+ self.assertEqual( len(tool_info), 2 )
self.assertEqual( len( tool_info['providers'] ), 3 )
@@ -313,6 +316,9 @@
importActionProviders( context )
self.assertEqual( len( atool.listActionProviders() ), 1 )
+ self.failIf( 'portal_foo' in atool.listActionProviders() )
+ self.failUnless( 'portal_actions' in atool.listActionProviders() )
+ self.assertEqual( len( atool.objectIds() ), 0 )
def test_empty_explicit_purge( self ):
@@ -332,6 +338,7 @@
self.assertEqual( len( atool.listActionProviders() ), 1 )
self.failIf( 'portal_foo' in atool.listActionProviders() )
self.failUnless( 'portal_actions' in atool.listActionProviders() )
+ self.assertEqual( len( atool.objectIds() ), 0 )
def test_empty_skip_purge( self ):
@@ -372,13 +379,18 @@
from Products.CMFSetup.actions import importActionProviders
importActionProviders( context )
- self.assertEqual( len( atool.listActionProviders() ), 3 )
- self.failUnless( 'portal_foo' in atool.listActionProviders() )
- self.failUnless( foo.listActions() )
- self.failUnless( 'portal_bar' in atool.listActionProviders() )
- self.failUnless( bar.listActions() )
+ self.assertEqual( len( atool.listActionProviders() ), 1 )
+ self.failIf( 'portal_foo' in atool.listActionProviders() )
self.failUnless( 'portal_actions' in atool.listActionProviders() )
+ self.assertEqual( len( atool.objectIds() ), 1 )
+ self.failUnless( 'dummy' in atool.objectIds() )
+ self.assertEqual( len( atool.dummy.objectIds() ) , 2 )
+ self.failUnless( 'foo' in atool.dummy.objectIds() )
+ self.failUnless( 'bar' in atool.dummy.objectIds() )
+ self.failIf( foo.listActions() )
+ self.failIf( bar.listActions() )
+
def test_normal_encode_as_ascii( self ):
site = self._initSite( 1, 1 )
@@ -392,12 +404,17 @@
from Products.CMFSetup.actions import importActionProviders
importActionProviders( context )
- self.assertEqual( len( atool.listActionProviders() ), 3 )
- self.failUnless( 'portal_foo' in atool.listActionProviders() )
- self.failUnless( foo.listActions() )
- self.failUnless( 'portal_bar' in atool.listActionProviders() )
- self.failUnless( bar.listActions() )
+ self.assertEqual( len( atool.listActionProviders() ), 1 )
+ self.failIf( 'portal_foo' in atool.listActionProviders() )
self.failUnless( 'portal_actions' in atool.listActionProviders() )
+
+ self.assertEqual( len( atool.objectIds() ), 1 )
+ self.failUnless( 'dummy' in atool.objectIds() )
+ self.assertEqual( len( atool.dummy.objectIds() ), 2 )
+ self.failUnless( 'foo' in atool.dummy.objectIds() )
+ self.failUnless( 'bar' in atool.dummy.objectIds() )
+ self.failIf( foo.listActions() )
+ self.failIf( bar.listActions() )
def test_suite():
More information about the CMF-checkins
mailing list