Example #1
0
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() == []
Example #2
0
 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(), [])
Example #3
0
 def test_clear_cache(self):
     cache = GenerationalCache()
     cache.add(self.obj1)
     cache.clear()
     self.assertEqual(cache.get_cached(), [])
Example #4
0
 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(), [])
Example #5
0
 def test_clear_cache(self):
     cache = GenerationalCache()
     cache.add(self.obj1)
     cache.clear()
     self.assertEqual(cache.get_cached(), [])
Example #6
0
def test_generational_cache_clear_cache(obj1):
    cache = GenerationalCache()
    cache.add(obj1)
    cache.clear()
    assert cache.get_cached() == []