Example #1
0
 def test_default_caches(self):
     assert caches.get_config() == {
         "default": {
             "cache": "aiocache.SimpleMemoryCache",
             "serializer": {"class": "aiocache.serializers.NullSerializer"},
         }
     }
Example #2
0
 def test_default_caches(self):
     assert caches.get_config() == {
         'default': {
             'cache': "aiocache.SimpleMemoryCache",
             'serializer': {
                 'class': "aiocache.serializers.NullSerializer"
             }
         }
     }
Example #3
0
    def test_add_new_entry(self):
        alias = "memory"
        config = {
            "cache": "aiocache.SimpleMemoryCache",
            "serializer": {"class": "aiocache.serializers.StringSerializer"},
        }
        caches.add(alias, config)

        assert caches.get_config()[alias] == config
Example #4
0
async def stop_plugins(app):
    cache_config = caches.get_config()
    for cache_name in cache_config:
        await caches.get(cache_name).close()