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))
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)