Exemple #1
0
class ConsistentHashingRouterTest(BaseTest):
    def setUp(self):
        self.router = ConsistentHashingRouter()
        self.hosts = dict((i, DummyConnection(i)) for i in range(5))
        self.cluster = Cluster(router=self.router, hosts=self.hosts)

    def get_db(self, **kwargs):
        kwargs.setdefault('cluster', self.cluster)
        return self.router.get_db(func='info', **kwargs)
Exemple #2
0
class ConsistentHashingRouterTest(BaseTest):

    def setUp(self):
        self.router = ConsistentHashingRouter()
        self.hosts = dict((i, DummyConnection(i)) for i in range(5))
        self.cluster = Cluster(router=self.router, hosts=self.hosts)

    def get_db(self, **kwargs):
        kwargs.setdefault('cluster', self.cluster)
        return self.router.get_db(func='info', **kwargs)
Exemple #3
0
 def setUp(self):
     self.router = ConsistentHashingRouter()
     self.hosts = dict((i, DummyConnection(i)) for i in range(5))
     self.cluster = Cluster(router=self.router, hosts=self.hosts)
Exemple #4
0
 def setUp(self):
     self.router = ConsistentHashingRouter()
     self.hosts = dict((i, DummyConnection(i)) for i in range(5))
     self.cluster = Cluster(router=self.router, hosts=self.hosts)