File: test_ext_mongodb.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 (17 lines) | stat: -rw-r--r-- 492 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from beaker.cache import Cache
from . import base


class TestMongoDB(base.CacheManagerBaseTests):
    SUPPORTS_TIMEOUT = False
    CACHE_ARGS = {
        'type': 'ext:mongodb',
        'url': 'mongodb://localhost:27017/beaker_testdb'
    }

    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)