Ejemplo n.º 1
0
    def test_configure(self):
        with self.assertRaises(KeyError):
            i = caches.get_interface('connection_name')

        dsn = 'caches.interface.Redis://host:1234/dbname#connection_name'
        caches.configure(dsn)
        i = caches.get_interface('connection_name')
        self.assertTrue(i)
Ejemplo n.º 2
0
    def test_configure(self):
        with self.assertRaises(KeyError):
            i = caches.get_interface('connection_name')

        dsn = 'caches.interface.Redis://host:1234/dbname#connection_name'
        caches.configure(dsn)
        i = caches.get_interface('connection_name')
        self.assertTrue(i)
Ejemplo n.º 3
0
    def test_configure_heroku_dsn(self):
        interfaces = caches.interfaces

        caches.interfaces = {}
        dsn = "caches.interface.Redis://*****:*****@grideye.redistogo.com:10174/"
        caches.configure(dsn)

        i = caches.get_interface()
        self.assertTrue(i)

        i = caches.get_interface('')
        self.assertTrue(i)

        caches.interfaces = interfaces
Ejemplo n.º 4
0
    def test_configure_heroku_dsn(self):
        interfaces = caches.interfaces

        caches.interfaces = {}
        dsn = "caches.interface.Redis://*****:*****@grideye.redistogo.com:10174/"
        caches.configure(dsn)

        i = caches.get_interface()
        self.assertTrue(i)

        i = caches.get_interface('')
        self.assertTrue(i)

        caches.interfaces = interfaces
Ejemplo n.º 5
0
 def get_set(self, *args, **kwargs):
     r = caches.get_interface()
     kwargs['redis'] = r
     s = CountingSet(*args, **kwargs)
     return s
Ejemplo n.º 6
0
 def get_set(self, *args, **kwargs):
     r = caches.get_interface()
     kwargs['redis'] = r
     s = CountingSet(*args, **kwargs)
     return s