Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(7)  |  Derive(0)  |  Import(1)

src/c/a/cache-busters-HEAD/cache_buster/test/test_caches.py   cache-busters(Download)
from twisted.trial.unittest import TestCase
 
from cache_buster.caches import InMemoryCache, MemcachedCache, MultiCache
 
 
    def test_delete_returns_true_when_key_is_present(self):
        cache = InMemoryCache({"foo": "bar"})
        d = cache.delete("foo")
        self.assertTrue(self.successResultOf(d))
 
    def test_delete_returns_false_when_is_not_present(self):
        cache = InMemoryCache({})
    def test_delete_removes_item_from_storage(self):
        storage = {"foo": "bar"}
        cache = InMemoryCache(storage)
        d = cache.delete("foo")
        self.successResultOf(d)
    def test_delete_returns_true_when_any_return_true(self):
        c1 = InMemoryCache({})
        c2 = InMemoryCache({"foo": "bar"})
        cache = MultiCache([c1, c2])
        d = cache.delete("foo")