Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFCore.tests.test_ActionsTool.ActionsToolTests Class Reference

List of all members.

Public Member Functions

def test_z2interfaces
def test_z3interfaces
def test_listActionProviders
def test_addActionProvider
def test_deleteActionProvider
def test_getActionObject

Private Member Functions

def _getTargetClass
def _makeOne

Detailed Description

Definition at line 34 of file test_ActionsTool.py.


Member Function Documentation

Definition at line 36 of file test_ActionsTool.py.

00036 
00037     def _getTargetClass(self):
00038         from Products.CMFCore.ActionsTool import ActionsTool
00039 
00040         return ActionsTool

def CMFCore.tests.test_ActionsTool.ActionsToolTests._makeOne (   self,
  args,
  kw 
) [private]

Definition at line 41 of file test_ActionsTool.py.

00041 
00042     def _makeOne(self, *args, **kw):
00043         return self._getTargetClass()(*args, **kw)

Here is the call graph for this function:

Definition at line 67 of file test_ActionsTool.py.

00067 
00068     def test_addActionProvider(self):
00069         tool = self._makeOne()
00070         tool.foo = 'acquirable attribute'
00071         tool.portal_url = 'acquirable attribute'
00072         tool.action_providers = ('portal_actions',)
00073         tool.addActionProvider('foo')
00074         self.assertEqual(tool.listActionProviders(),
00075                           ('portal_actions', 'foo'))
00076         tool.addActionProvider('portal_url')
00077         tool.addActionProvider('foo')
00078         self.assertEqual(tool.listActionProviders(),
00079                           ('portal_actions', 'foo', 'portal_url'))

Here is the call graph for this function:

Definition at line 80 of file test_ActionsTool.py.

00080 
00081     def test_deleteActionProvider(self):
00082         tool = self._makeOne()
00083         tool.action_providers = ('portal_actions', 'foo')
00084         tool.deleteActionProvider('foo')
00085         self.assertEqual(tool.listActionProviders(), ('portal_actions',))

Here is the call graph for this function:

Definition at line 86 of file test_ActionsTool.py.

00086 
00087     def test_getActionObject(self):
00088         tool = self._makeOne()
00089         tool._setObject('object', ActionCategory('object'))
00090         tool.object._setObject('newstyle_id', Action('newstyle_id'))
00091         tool.addAction('an_id', 'name', '', '', '', 'object')
00092         rval = tool.getActionObject('object/an_id')
00093         self.assertEqual(rval, tool._actions[0])
00094         rval = tool.getActionObject('object/newstyle_id')
00095         self.assertEqual(rval, None)
00096         rval = tool.getActionObject('object/not_existing_id')
00097         self.assertEqual(rval, None)
00098         self.assertRaises(ValueError, tool.getActionObject, 'wrong_format')
00099 

Here is the call graph for this function:

Definition at line 62 of file test_ActionsTool.py.

00062 
00063     def test_listActionProviders(self):
00064         tool = self._makeOne()
00065         tool.action_providers = ('portal_actions',)
00066         self.assertEqual(tool.listActionProviders(), ('portal_actions',))

Here is the call graph for this function:

Definition at line 44 of file test_ActionsTool.py.

00044 
00045     def test_z2interfaces(self):
00046         from Interface.Verify import verifyClass
00047         from Products.CMFCore.interfaces.portal_actions \
00048                 import ActionProvider as IActionProvider
00049         from Products.CMFCore.interfaces.portal_actions \
00050                 import portal_actions as IActionsTool
00051 
00052         verifyClass(IActionProvider, self._getTargetClass())
00053         verifyClass(IActionsTool, self._getTargetClass())

Here is the call graph for this function:

Definition at line 54 of file test_ActionsTool.py.

00054 
00055     def test_z3interfaces(self):
00056         from zope.interface.verify import verifyClass
00057         from Products.CMFCore.interfaces import IActionProvider
00058         from Products.CMFCore.interfaces import IActionsTool
00059 
00060         verifyClass(IActionProvider, self._getTargetClass())
00061         verifyClass(IActionsTool, self._getTargetClass())

Here is the call graph for this function:


The documentation for this class was generated from the following file: