Exemplo n.º 1
0
 def test_capacity_set(self):
     for size in SIZES:
         l = TTLRU(size)
         for i in range(size + 5):
             l[i] = str(i)
         l.set_size(size + 10)
         self.assertTrue(size + 10 == l.get_size())
         self.assertTrue(len(l) == size)
         for i in range(size + 20):
             l[i] = str(i)
         self.assertTrue(len(l) == size + 10)
         l.set_size(size + 10 - 1)
         self.assertTrue(len(l) == size + 10 - 1)
Exemplo n.º 2
0
 def test_capacity_get(self):
     for size in SIZES:
         l = TTLRU(size)
         self.assertTrue(size == l.get_size())