Ejemplo n.º 1
0
def set_up_redis(tmp, addCleanup):
    from osmpoint.testing import redis_sock_path
    if redis_sock_path is not None:
        return redis_sock_path

    from osmpoint.database import redis_server_process
    sock_path = tmp/'redis.sock'
    data_path = tmp/'redis.db'
    p = redis_server_process(str(sock_path), str(data_path), persist=False)
    p.__enter__()
    addCleanup(lambda: p.__exit__(None, None, None))
    return sock_path
Ejemplo n.º 2
0
    def begin(self):
        import py.path
        from osmpoint.database import redis_server_process

        self.tmp = py.path.local.mkdtemp()
        log.info("starting up redis in %r", self.tmp)

        sock_path = self.tmp/'redis.sock'
        data_path = self.tmp/'redis.db'

        self.process = redis_server_process(str(sock_path), str(data_path),
                                            persist=False)
        self.process.__enter__()

        global redis_sock_path
        redis_sock_path = sock_path
Ejemplo n.º 3
0
    def begin(self):
        import py.path
        from osmpoint.database import redis_server_process

        self.tmp = py.path.local.mkdtemp()
        log.info("starting up redis in %r", self.tmp)

        sock_path = self.tmp / 'redis.sock'
        data_path = self.tmp / 'redis.db'

        self.process = redis_server_process(str(sock_path),
                                            str(data_path),
                                            persist=False)
        self.process.__enter__()

        global redis_sock_path
        redis_sock_path = sock_path