Back to index

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

List of all members.

Public Member Functions

def test_extractCredentials_no_creds
def test_extractCredentials_with_form_creds
def test_challenge

Private Member Functions

def _getTargetClass
def _makeOne
def _makeTree

Detailed Description

Definition at line 50 of file test_InlineAuthHelper.py.


Member Function Documentation

Definition at line 52 of file test_InlineAuthHelper.py.

00052 
00053     def _getTargetClass( self ):
00054 
00055         from Products.PluggableAuthService.plugins.InlineAuthHelper \
00056             import InlineAuthHelper
00057 
00058         return InlineAuthHelper

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

Definition at line 59 of file test_InlineAuthHelper.py.

00059 
00060     def _makeOne( self, id='test', *args, **kw ):
00061 
00062         return self._getTargetClass()( id=id, *args, **kw )

Definition at line 63 of file test_InlineAuthHelper.py.

00063 
00064     def _makeTree( self ):
00065 
00066         rc = FauxObject( 'rc' )
00067         root = FauxRoot( 'root' ).__of__( rc )
00068         folder = FauxContainer( 'folder' ).__of__( root )
00069         object = FauxObject( 'object' ).__of__( folder )
00070 
00071         return rc, root, folder, object

Here is the caller graph for this function:

Definition at line 94 of file test_InlineAuthHelper.py.

00094 
00095     def test_challenge( self ):
00096         from zExceptions import Unauthorized
00097         rc, root, folder, object = self._makeTree()
00098         response = FauxInlineResponse()
00099         request = FauxRequest(RESPONSE=response)
00100         root.REQUEST = request
00101 
00102         helper = self._makeOne().__of__(root)
00103         helper.body = "Overridden"
00104 
00105         self.assertEqual(response.body, "Should never see this.")
00106         helper.challenge(request, response)
00107         self.assertEqual(response.body, "Overridden")

Definition at line 72 of file test_InlineAuthHelper.py.

00072 
00073     def test_extractCredentials_no_creds( self ):
00074 
00075         helper = self._makeOne()
00076         response = FauxInlineResponse()
00077         request = FauxRequest(RESPONSE=response)
00078 
00079         self.assertEqual( helper.extractCredentials( request ), {} )

Definition at line 80 of file test_InlineAuthHelper.py.

00080 
00081     def test_extractCredentials_with_form_creds( self ):
00082 
00083         helper = self._makeOne()
00084         response = FauxInlineResponse()
00085         request = FauxSettableRequest(__ac_name='foo',
00086                                       __ac_password='bar',
00087                                       RESPONSE=response)
00088 
00089         self.assertEqual(helper.extractCredentials(request),
00090                         {'login': 'foo',
00091                          'password': 'bar',
00092                          'remote_host': '',
00093                          'remote_address': ''})


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