Exemple #1
0
 def test_get_set(self):
     cache = SimpleCache()
     self.assertIsNone(cache._get('a', {}))
     cache._set('a', 1, {})
     self.assertEquals(1, cache._get('a', {}))
     cache._delete('a', {})
     self.assertIsNone(cache._get('a', {}))
Exemple #2
0
 def test_get_set(self):
     cache = SimpleCache()
     self.assertIsNone(cache.get('a'))
     cache.set('a', 1)
     self.assertEquals(1, cache.get('a'))
     cache.delete('a')
     self.assertIsNone(cache.get('a'))
Exemple #3
0
 def setUp(self):
     super(CacheTest, self).setUp()
     self.cache = SimpleCache()
     self.calls = 0
Exemple #4
0
 def test_clear(self):
     cache = SimpleCache()
     cache._set('a', 1, {})
     cache.clear()
     self.assertIsNone(cache._get('a', {}))
Exemple #5
0
 def test_clear(self):
     cache = SimpleCache()
     cache.set('a', 1)
     cache.clear()
     self.assertIsNone(cache.get('a'))