File: test_ext_redis.py

package info (click to toggle)
beaker 1.13.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 716 kB
  • sloc: python: 6,036; makefile: 62
file content (16 lines) | stat: -rw-r--r-- 445 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from beaker.cache import Cache
from . import base


class TestRedis(base.CacheManagerBaseTests):
    CACHE_ARGS = {
        'type': 'ext:redis',
        'url': 'redis://localhost:6379/13'
    }

    def test_client_reuse(self):
        cache1 = Cache('test1', **self.CACHE_ARGS)
        cli1 = cache1.namespace.client
        cache2 = Cache('test2', **self.CACHE_ARGS)
        cli2 = cache2.namespace.client
        self.assertTrue(cli1 is cli2)