Exemple #1
0
def test_explicit_evict():
    d = dict()
    lru = LRU(10, d)

    lru['x'] = 1
    lru['y'] = 2

    assert set(d) == {'x', 'y'}

    lru.evict()
    assert set(d) == {'y'}
Exemple #2
0
def test_explicit_evict():
    d = dict()
    lru = LRU(10, d)

    lru["x"] = 1
    lru["y"] = 2

    assert set(d) == {"x", "y"}

    k, v, w = lru.evict()
    assert set(d) == {"y"}
    assert k == "x"
    assert v == 1
    assert w == 1
Exemple #3
0
def test_explicit_evict():
    d = dict()
    lru = LRU(10, d)

    lru['x'] = 1
    lru['y'] = 2

    assert set(d) == {'x', 'y'}

    k, v, w = lru.evict()
    assert set(d) == {'y'}
    assert k == 'x'
    assert v == 1
    assert w == 1