示例#1
0
    def testKVSClient(self):
        try:
            from kvs.redis_client import get_client
        except ImportError:
            return

        client = get_client(name='glot', setting={'glot': {'HOST': 'localhost'}})
        self._assertInit(client)
        self.tearDown()
        self._assertGet(client)
示例#2
0
    def testKVSClient(self):
        try:
            from kvs.redis_client import get_client
        except ImportError:
            return

        client = get_client(name='glot',
                            setting={'glot': {
                                'HOST': 'localhost'
                            }})
        self._assertInit(client)
        self.tearDown()
        self._assertGet(client)
示例#3
0
    def _redis_kwargs(self, client, kwargs):
        if client is not None:
            kwargs['client'] = client
            return kwargs

        if self._use_kvs_module_connection == True:
            from kvs.redis_client import get_client
            kwargs['client'] = get_client(name=self._db, setting=self._redis)
            return kwargs

        kwargs['host'] = self.redis_host
        kwargs['port'] = self.redis_port
        kwargs['db'] = self.redis_db
        return kwargs