コード例 #1
0
ファイル: test_cache.py プロジェクト: abourget/webassets
 def test_memory_cache_capacity(self):
     c = MemoryCache(capacity=2)
     c.set('foo', 'bar')
     assert c.get('foo') == 'bar'
     # Since we have capacity=2, adding two more keys will
     # remove the first one.
     c.set('key2', 'value2')
     c.set('key3', 'value3')
     assert c.get('foo') is None
コード例 #2
0
 def test_memory_cache_capacity(self):
     c = MemoryCache(capacity=2)
     c.set('foo', 'bar')
     assert c.get('foo') == 'bar'
     # Since we have capacity=2, adding two more keys will
     # remove the first one.
     c.set('key2', 'value2')
     c.set('key3', 'value3')
     assert c.get('foo') is None
コード例 #3
0
 def get(self, key):
     self.getc += 1
     return MemoryCache.get(self, key)
コード例 #4
0
ファイル: test_bundle_build.py プロジェクト: JDeuce/webassets
 def get(self, key):
     self.getc += 1
     return MemoryCache.get(self, key)