def test_generational_cache_clear_cache_clears_the_second_generation( obj1, obj2): cache = GenerationalCache(1) cache.add(obj1) cache.add(obj2) cache.clear() assert cache.get_cached() == []
def test_clear_cache_clears_the_second_generation(self): cache = GenerationalCache(1) cache.add(self.obj1) cache.add(self.obj2) cache.clear() self.assertEqual(cache.get_cached(), [])
def test_clear_cache(self): cache = GenerationalCache() cache.add(self.obj1) cache.clear() self.assertEqual(cache.get_cached(), [])
def test_generational_cache_clear_cache(obj1): cache = GenerationalCache() cache.add(obj1) cache.clear() assert cache.get_cached() == []