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
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
def test_memory_hit(tmp_path): c = Cache(tmp_path) r = 10 c.set_inmem('dude', r) assert c.lookup_inmem('dude') is r
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
def test_memory_miss(tmp_path): c = Cache(tmp_path) assert c.lookup_inmem('dude') is None