Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
PluggableAuthService.plugins.tests.test_LocalRolePlugin.LocalRolePluginTestCase Class Reference
Inheritance diagram for PluggableAuthService.plugins.tests.test_LocalRolePlugin.LocalRolePluginTestCase:
Inheritance graph
[legend]
Collaboration diagram for PluggableAuthService.plugins.tests.test_LocalRolePlugin.LocalRolePluginTestCase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_no_local_roles
def test_some_local_roles

Private Member Functions

def _getTargetClass
def _makeOne
def _makeTree

Detailed Description

Definition at line 85 of file test_LocalRolePlugin.py.


Member Function Documentation

Definition at line 87 of file test_LocalRolePlugin.py.

00087 
00088     def _getTargetClass( self ):
00089 
00090         from Products.PluggableAuthService.plugins.LocalRolePlugin \
00091              import LocalRolePlugin
00092 
00093         return LocalRolePlugin

def PluggableAuthService.plugins.tests.test_LocalRolePlugin.LocalRolePluginTestCase._makeOne (   self,
  id = 'test',
  args,
  kw 
) [private]

Definition at line 94 of file test_LocalRolePlugin.py.

00094 
00095     def _makeOne( self, id='test', *args, **kw ):
00096 
00097         return self._getTargetClass()( id, *args, **kw )

Definition at line 98 of file test_LocalRolePlugin.py.

00098 
00099     def _makeTree( self ):
00100 
00101         rc = FauxObject( 'rc' )
00102         root = FauxRoot( 'root' ).__of__( rc )
00103         folder = FauxContainer( 'folder' ).__of__( root )
00104         object = FauxObject( 'object' ).__of__( folder )
00105 
00106         return rc, root, folder, object

Here is the caller graph for this function:

Definition at line 107 of file test_LocalRolePlugin.py.

00107 
00108     def test_no_local_roles( self ):
00109 
00110         rc, root, folder, object = self._makeTree()
00111         
00112         lrp = self._makeOne( 'no_roles' ).__of__(root)
00113 
00114         user = FauxUser( 'loser' ).__of__(root)
00115 
00116         self.assertEquals( lrp.getRolesForPrincipal( user ), None )

Definition at line 117 of file test_LocalRolePlugin.py.

00117 
00118     def test_some_local_roles( self ):
00119 
00120         rc, root, folder, object = self._makeTree()
00121 
00122         root.__ac_local_roles__ = { 'some_manager' : [ 'Manager' ] }
00123         
00124         lrp = self._makeOne( 'roles' ).__of__(root)
00125 
00126         user = FauxUser( 'some_manager' ).__of__(root)
00127 
00128         self.assertEquals( lrp.getRolesForPrincipal( user ), [ 'Manager' ] )


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