Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)