Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.keyring.tests.testKeymanager.KeyManagerTests Class Reference
Inheritance diagram for plone.keyring.tests.testKeymanager.KeyManagerTests:
Inheritance graph
[legend]
Collaboration diagram for plone.keyring.tests.testKeymanager.KeyManagerTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def testInterface
def testSystemKeyringCreated
def testContainerIsPersistent
def testClear
def testClearGivenRing
def testClearAll
def testClearUnknownRing
def testRotate
def testRotateGivenRing
def testRotateAll
def testRotateUnknownRing
def testSecret
def testSecretGivenRing
def testSecretUnknownRing

Public Attributes

 mgr

Detailed Description

Definition at line 14 of file testKeymanager.py.


Member Function Documentation

Definition at line 15 of file testKeymanager.py.

00015 
00016     def setUp(self):
00017         self.mgr=KeyManager()
00018         del self.mgr[u"_system"]
00019         self.mgr[u"_system"]=Keyring()
00020         self.mgr[u"_system"].rotate()
00021         self.mgr[u"one"]=Keyring()
00022         self.mgr[u"one"].rotate()
00023         self.mgr[u"two"]=Keyring()
00024         self.mgr[u"two"].rotate()
00025 

Definition at line 42 of file testKeymanager.py.

00042 
00043     def testClear(self):
00044         self.mgr.clear()
00045         self.assertEqual(set(self.mgr[u"_system"]), set([None]))
00046         self.assertNotEqual(set(self.mgr[u"one"]), set([None]))
00047         self.assertNotEqual(set(self.mgr[u"two"]), set([None]))
00048 

Definition at line 56 of file testKeymanager.py.

00056 
00057     def testClearAll(self):
00058         self.mgr.clear(None)
00059         self.assertEqual(set(self.mgr[u"_system"]), set([None]))
00060         self.assertEqual(set(self.mgr[u"one"]), set([None]))
00061         self.assertEqual(set(self.mgr[u"two"]), set([None]))
00062 

Definition at line 49 of file testKeymanager.py.

00049 
00050     def testClearGivenRing(self):
00051         self.mgr.clear(u"one")
00052         self.assertNotEqual(set(self.mgr[u"_system"]), set([None]))
00053         self.assertEqual(set(self.mgr[u"one"]), set([None]))
00054         self.assertNotEqual(set(self.mgr[u"two"]), set([None]))
00055 

Definition at line 63 of file testKeymanager.py.

00063 
00064     def testClearUnknownRing(self):
00065         self.assertRaises(KeyError, self.mgr.clear, u"missing")
00066 

Definition at line 36 of file testKeymanager.py.

00036 
00037     def testContainerIsPersistent(self):
00038         mgr=KeyManager()
00039         self.failUnless(isinstance(mgr.__dict__["_SampleContainer__data"],
00040                                    PersistentMapping))
00041 

Definition at line 26 of file testKeymanager.py.

00026 
00027     def testInterface(self):
00028         verifyClass(IKeyManager, KeyManager)
00029 

Definition at line 67 of file testKeymanager.py.

00067 
00068     def testRotate(self):
00069         current_sys = self.mgr[u"_system"].current
00070         current_one = self.mgr[u"one"].current
00071         current_two = self.mgr[u"two"].current
00072         self.mgr.rotate()
00073         self.assertNotEqual(self.mgr[u"_system"].current, current_sys)
00074         self.assertEqual(self.mgr[u"_system"][1], current_sys)
00075         self.assertEqual(self.mgr[u"one"].current, current_one)
00076         self.assertEqual(self.mgr[u"one"][1], None)
00077         self.assertEqual(self.mgr[u"two"].current, current_two)
00078         self.assertEqual(self.mgr[u"two"][1], None)
00079 

Definition at line 93 of file testKeymanager.py.

00093 
00094     def testRotateAll(self):
00095         current_sys = self.mgr[u"_system"].current
00096         current_one = self.mgr[u"one"].current
00097         current_two = self.mgr[u"two"].current
00098         self.mgr.rotate(None)
00099         self.assertNotEqual(self.mgr[u"_system"].current, current_sys)
00100         self.assertEqual(self.mgr[u"_system"][1], current_sys)
00101         self.assertNotEqual(self.mgr[u"one"].current, current_one)
00102         self.assertEqual(self.mgr[u"one"][1], current_one)
00103         self.assertNotEqual(self.mgr[u"two"].current, current_two)
00104         self.assertEqual(self.mgr[u"two"][1], current_two)
00105 

Definition at line 80 of file testKeymanager.py.

00080 
00081     def testRotateGivenRing(self):
00082         current_sys = self.mgr[u"_system"].current
00083         current_one = self.mgr[u"one"].current
00084         current_two = self.mgr[u"two"].current
00085         self.mgr.rotate(u"one")
00086         self.assertEqual(self.mgr[u"_system"].current, current_sys)
00087         self.assertEqual(self.mgr[u"_system"][1], None)
00088         self.assertNotEqual(self.mgr[u"one"].current, current_one)
00089         self.assertEqual(self.mgr[u"one"][1], current_one)
00090         self.assertEqual(self.mgr[u"two"].current, current_two)
00091         self.assertEqual(self.mgr[u"two"][1], None)
00092 

Definition at line 106 of file testKeymanager.py.

00106 
00107     def testRotateUnknownRing(self):
00108         self.assertRaises(KeyError, self.mgr.clear, u"missing")
00109 

Definition at line 110 of file testKeymanager.py.

00110 
00111     def testSecret(self):
00112         self.mgr[u"_system"][0]=marker
00113         self.failUnless(self.mgr.secret() is marker)

Definition at line 114 of file testKeymanager.py.

00114 
00115     def testSecretGivenRing(self):
00116         self.mgr[u"one"][0]=marker
00117         self.failUnless(self.mgr.secret(u"one") is marker)

Definition at line 118 of file testKeymanager.py.

00118 
00119     def testSecretUnknownRing(self):
00120         self.assertRaises(KeyError, self.mgr.secret, u"missing")

Definition at line 30 of file testKeymanager.py.

00030 
00031     def testSystemKeyringCreated(self):
00032         mgr=KeyManager()
00033         self.assertEqual(mgr.keys(), [ u"_system" ])
00034         self.failUnless(mgr[u"_system"].current is not None)
00035 


Member Data Documentation

Definition at line 16 of file testKeymanager.py.


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