Back to index

plone3  3.1.7
Public Member Functions
plone.keyring.tests.testKeyring.KeyringTests Class Reference
Inheritance diagram for plone.keyring.tests.testKeyring.KeyringTests:
Inheritance graph
[legend]
Collaboration diagram for plone.keyring.tests.testKeyring.KeyringTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def testInterface
def testConstructionDefaultSize
def testConstructionSize
def testKeyringStartsEmpty
def testIterate
def testClear
def testRotate
def testRotateTwice
def testCurrent

Detailed Description

Definition at line 9 of file testKeyring.py.


Member Function Documentation

Definition at line 32 of file testKeyring.py.

00032 
00033     def testClear(self):
00034         ring=Keyring()
00035         ring.data=[0, 1, 2]
00036         ring.clear()
00037         self.assertEqual(ring.data, [ None, None, None ])

Definition at line 13 of file testKeyring.py.

00013 
00014     def testConstructionDefaultSize(self):
00015         ring=Keyring()
00016         self.assertEqual(len(ring), 5)

Definition at line 17 of file testKeyring.py.

00017 
00018     def testConstructionSize(self):
00019         ring=Keyring(3)
00020         self.assertEqual(len(ring), 3)

Definition at line 52 of file testKeyring.py.

00052 
00053     def testCurrent(self):
00054         ring=Keyring()
00055         marker=[]
00056         ring.data=[marker, 1, 2, 3]
00057         self.failUnless(ring.current is marker)
00058 

Definition at line 10 of file testKeyring.py.

00010 
00011     def testInterface(self):
00012         verifyClass(IKeyring, Keyring)

Definition at line 25 of file testKeyring.py.

00025 
00026     def testIterate(self):
00027         ring=Keyring()
00028         ring.data=[0, 1, 2, 3, 4]
00029         iterator=ring.__iter__()
00030         self.failUnless(isinstance(iterator, types.GeneratorType))
00031         self.assertEqual(list(iterator), [0, 1, 2, 3, 4])

Definition at line 21 of file testKeyring.py.

00021 
00022     def testKeyringStartsEmpty(self):
00023         ring=Keyring()
00024         self.assertEqual(set(list(ring)), set([None]))

Definition at line 38 of file testKeyring.py.

00038 
00039     def testRotate(self):
00040         ring=Keyring()
00041         ring.rotate()
00042         self.failIf(ring.current is None)
00043         self.assertEqual(ring.data[1:], [ None, None, None, None])

Definition at line 44 of file testKeyring.py.

00044 
00045     def testRotateTwice(self):
00046         ring=Keyring()
00047         ring.rotate()
00048         ring.rotate()
00049         self.failUnless(ring.data[0] is not None)
00050         self.failUnless(ring.data[1] is not None)
00051         self.assertEqual(ring.data[2:], [ None, None, None])


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