|
|
Choosing A Webhost: |
CVS: CMF/CMFSetup/tests - test_actions.py:1.11: msg#00060web.zope.cmf.cvs
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():
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | CVS: CMF/CMFSetup - actions.py:1.18, Yvo Schubbe |
|---|---|
| Next by Date: | CVS: CMF/CMFSetup/xml - apcExport.xml:1.3, Yvo Schubbe |
| Previous by Thread: | CVS: CMF/CMFSetup - actions.py:1.18, Yvo Schubbe |
| Next by Thread: | CVS: CMF/CMFSetup/xml - apcExport.xml:1.3, Yvo Schubbe |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |