def test_expired(self): cache = Memory() cache.set('test', 'value', -1) assert cache.expired('test')
def test_set(self): cache = Memory() cache['test'] = 'test' cache.set('expired', 'value', -1) assert cache['test'] == 'test' assert not cache['expired']