コード例 #1
0
def test_memory_hit_accross(tmp_path):
    c1 = Cache(tmp_path)
    r = 10
    c1.set_inmem('dude', r)
    c2 = Cache(tmp_path)
    assert c2.lookup_inmem('dude') is r
コード例 #2
0
def test_ic_memory_hit_ds_level(tmp_path):
    c = Cache(tmp_path, ignore_cache=True)
    r = 10
    c.set_inmem('dude', r)
    assert c.lookup_inmem('dude') is None
コード例 #3
0
def test_memory_hit(tmp_path):
    c = Cache(tmp_path)
    r = 10
    c.set_inmem('dude', r)
    assert c.lookup_inmem('dude') is r
コード例 #4
0
def test_ic_memory_hit_ds_context(tmp_path):
    c = Cache(tmp_path)
    r = 10
    c.set_inmem('dude', r)
    with c.ignore_cache():
        assert c.lookup_inmem('dude') is None
コード例 #5
0
def test_memory_miss(tmp_path):
    c = Cache(tmp_path)
    assert c.lookup_inmem('dude') is None