Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.protect.tests.testAuthenticator.VerifyTests Class Reference
Inheritance diagram for plone.protect.tests.testAuthenticator.VerifyTests:
Inheritance graph
[legend]
Collaboration diagram for plone.protect.tests.testAuthenticator.VerifyTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def setAuthenticator
def testCorrectAuthenticator
def testOlderSecretVerifies
def testMissingAuthenticator
def testIncorrectAuthenticator
def testAuthenticatorWrongType
def tearDown

Public Attributes

 request
 view
 sm
 manager

Detailed Description

Definition at line 57 of file testAuthenticator.py.


Member Function Documentation

Definition at line 64 of file testAuthenticator.py.

00064 
00065     def setAuthenticator(self, key):
00066         user=getSecurityManager().getUser().getUserName()
00067         auth=hmac.new(key, user, sha).hexdigest()
00068         self.request["_authenticator"]=auth
00069 

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from plone.protect.tests.case.KeyringTestCase.

Definition at line 58 of file testAuthenticator.py.

00058 
00059     def setUp(self):
00060         self.request={}
00061         KeyringTestCase.setUp(self)
00062         self.view=AuthenticatorView(None, self.request)
00063 

Definition at line 31 of file case.py.

00031 
00032     def tearDown(self):
00033         self.sm.unregisterUtility(self.manager, provided=IKeyManager)
00034         noSecurityManager()
00035 

Definition at line 91 of file testAuthenticator.py.

00091 
00092     def testAuthenticatorWrongType(self):
00093         self.request["_authenticator"]=123
00094         self.assertEqual(self.view.verify(), False)
00095 
00096 

Definition at line 70 of file testAuthenticator.py.

00070 
00071     def testCorrectAuthenticator(self):
00072         self.manager.keys[0]=("secret")
00073         self.setAuthenticator("secret")
00074         self.assertEqual(self.view.verify(), True)
00075 

Here is the call graph for this function:

Definition at line 86 of file testAuthenticator.py.

00086 
00087     def testIncorrectAuthenticator(self):
00088         self.request["_authenticator"]="incorrect"
00089         self.assertEqual(self.view.verify(), False)
00090 

Definition at line 82 of file testAuthenticator.py.

00082 
00083     def testMissingAuthenticator(self):
00084         self.assertEqual(self.view.verify(), False)
00085 

Definition at line 76 of file testAuthenticator.py.

00076 
00077     def testOlderSecretVerifies(self):
00078         self.manager.keys[3]="backup"
00079         self.setAuthenticator("backup")
00080         self.assertEqual(self.view.verify(), True)
00081 

Here is the call graph for this function:


Member Data Documentation

Definition at line 25 of file case.py.

Definition at line 59 of file testAuthenticator.py.

Definition at line 24 of file case.py.

Definition at line 61 of file testAuthenticator.py.


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