Exemplo n.º 1
0
class BaseCmdTest(unittest.TestCase):
    def setUp(self):
        host = "192.168.1.106";
        port = 6379;
        self.client = PiedisClient()
        self.client.setHost(host)
        self.client.setPort(port)
        
    def tearDown(self):
        self.client.close()
Exemplo n.º 2
0
 def getClientByNode(self, shardNodeInfo):
     client = self.serverClientMapping.get(shardNodeInfo)
     if client != None:
         return client
     client = PiedisClient()
     client.setHost(shardNodeInfo.getHost())
     client.setPort(shardNodeInfo.getPort())
     client.setConnectTimeout(self.connectTimeout)
     self.serverClientMapping[shardNodeInfo] = client
     return client