def test_items(): cache = FSLRUCache(maxsize=3, clear_on_start=True) cache["hello"] = "world" for k, v in cache.items(): assert k == "hello" assert v == "world"
def test_items_keyerror_squashed(): cache = FSLRUCache(maxsize=5) cache["a"] = 1 cache["b"] = 2 items = cache.items() del cache["b"] for k, v in items: assert True