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