[CMF-checkins] CVS: CMF/CMFCore/tests - test_ActionsTool.py:1.1.2.3

Andrew Sawyers andrew@zope.com
Fri, 4 Jan 2002 09:30:21 -0500


Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv31405/CMFCore/tests

Modified Files:
      Tag: andrew_ttw_actions-branch
	test_ActionsTool.py 
Log Message:

*added a few more actions tool unit tests.
*removed debugging kruft from ActionsTool


=== CMF/CMFCore/tests/test_ActionsTool.py 1.1.2.2 => 1.1.2.3 ===
 from AccessControl import SecurityManager
 from Products.CMFCore.ActionsTool import *
+from Products.CMFDefault.URLTool import *
 from Products.CMFCore.CMFCorePermissions import AddPortalContent
 from Products.CMFCore.CMFCorePermissions import ModifyPortalContent
 from Products.CMFCore import utils
@@ -68,12 +69,26 @@
         root.REQUEST = ZPublisher.HTTPRequest.HTTPRequest( None, env, None )
         
         root._setObject( 'portal_actions', ActionsTool() )
-        self.tool = tool = root.portal_actions
-        tool.action_providers = ('portal_actions',)
+        root._setObject('foo', URLTool() )
+        self.tool = root.portal_actions
+        self.ut = root.foo
+        self.tool.action_providers = ('portal_actions',)
 
     def test_actionProviders(self):
         tool = self.tool
         self.assertEqual(tool.listActionProviders(), ('portal_actions',))
+
+    def test_addActionProvider(self):
+        tool = self.tool
+        tool.addActionProvider('foo')
+        self.assertEqual(tool.listActionProviders(),
+                          ('portal_actions', 'foo'))
+
+    def test_delActionProvider(self):
+        tool = self.tool
+        tool.deleteActionProvider('foo')
+        self.assertEqual(tool.listActionProviders(),
+                          ('portal_actions',))
 
     def tearDown( self ):
         get_transaction().abort()