コード例 #1
0
ファイル: test_cache.py プロジェクト: timstoop/kubefuse
 def test_cache_miss(self):
     cache = ExpiringCache(expire_in_seconds = 10)
     assert_that(cache.get('nonexisting'), equal_to(None))
コード例 #2
0
ファイル: test_cache.py プロジェクト: timstoop/kubefuse
 def test_cache_get_set(self):
     cache = ExpiringCache(expire_in_seconds = 3600)
     cache.set("key", "value")
     assert_that(cache.get("key"), equal_to("value"))
コード例 #3
0
ファイル: test_cache.py プロジェクト: timstoop/kubefuse
 def test_cache_expired(self):
     cache = ExpiringCache(expire_in_seconds = -10) # expires straight away
     cache.set("key", "value")
     assert_that(cache.get('key'), equal_to(None))