def test_cache(): c = cache.DictCache() key = (0, 1) value = 'value' assert c.get(key) is None assert c.hits == 0 assert c.misses == 1 assert c.info() == (0, 1, 0) assert c.size() == 0 c.set(key, value) assert c.get(key) == value assert c.hits == 1 assert c.misses == 1 assert c.info() == (1, 1, 1) assert c.size() == 1 c.clear() assert c.size() == 0 assert c.hits == 0 assert c.misses == 0
def test_cache_key_generation(): c = cache.DictCache() assert c.key('arg', _prefix='CONSTANT') == ('CONSTANT', 'arg')
def __init__(self): self.repertoire_cache = cache.DictCache()
def __init__(self): self.my_cache = cache.DictCache()
def test_cache_key_generation(): c = cache.DictCache() assert c.key("arg", _prefix="CONSTANT") == ("CONSTANT", "arg")