Пример #1
0
    def test_insert_overflow(self):

        lru = LRUCache(4)

        for x in range(6):
            lru.set(x)

        self.assertFalse(lru.has_key(1))
        for x in range(2, 6):
            self.assertTrue(lru.has_key(x))
Пример #2
0
    def test_insert_overflow(self):

        lru = LRUCache(4)

        for x in range(6):
            lru.set(x)

        self.assertNotIn(1, lru)
        for x in range(2, 6):
            self.assertIn(x, lru)
Пример #3
0
    def test_insert_overflow(self):

        lru = LRUCache(4)

        for x in range(6):
            lru.set(x)

        self.assertFalse(lru.has_key(1))
        for x in range(2, 6):
            self.assertTrue(lru.has_key(x))