Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes | Static Public Attributes
datatests.LRUTest Class Reference

List of all members.

Public Member Functions

def spaceFunc
def runTest

Public Attributes

 funccount

Static Public Attributes

tuple expected

Detailed Description

Definition at line 44 of file datatests.py.


Member Function Documentation

def datatests.LRUTest.runTest (   self)

Definition at line 61 of file datatests.py.

00061 
00062     def runTest(self):
00063         self.funccount = 0
00064         c = pymake.util.LRUCache(3, self.spaceFunc, lambda k, v: k % 2)
00065         self.assertEqual(tuple(c.debugitems()), ())
00066 
00067         for i in xrange(0, len(self.expected)):
00068             k, e, fc, di = self.expected[i]
00069 
00070             v = c.get(k)
00071             self.assertEqual(v, e)
00072             self.assertEqual(self.funccount, fc,
00073                              "funccount, iteration %i, got %i expected %i" % (i, self.funccount, fc))
00074             goti = tuple(c.debugitems())
00075             self.assertEqual(goti, di,
00076                              "debugitems, iteration %i, got %r expected %r" % (i, goti, di))

def datatests.LRUTest.spaceFunc (   self,
  l 
)

Definition at line 57 of file datatests.py.

00057 
00058     def spaceFunc(self, l):
00059         self.funccount += 1
00060         return ''.ljust(l)


Member Data Documentation

Initial value:
(
        (0, '', 1, (0,)),
        (0, '', 2, (0,)),
        (1, ' ', 3, (1, 0)),
        (1, ' ', 3, (1, 0)),
        (0, '', 4, (0, 1)),
        (2, '  ', 5, (2, 0, 1)),
        (1, ' ', 5, (1, 2, 0)),
        (3, '   ', 6, (3, 1, 2)),
    )

Definition at line 46 of file datatests.py.

Definition at line 62 of file datatests.py.


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