Ejemplo n.º 1
0
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"
Ejemplo n.º 2
0
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