andymccurdy/redis-py — pull request #337 by cav71 (2013-04-17 11:46:53+00:00)
Title: redis server launcher and unittest testcase

This is a helper class to launch a background redis server:

```
# Dictionary to TestServer will be translated
# into redis key configuration entries
with redis.test_server.TestServer({ 'port' : 9999, }) as server:
server.start()
pool = redis.ConnectionPool(**server.get_pool_args())
connection = redis.Redis(connection_pool=pool)
print connection.config_get()

# Same as previous non context aware

server = redis.test_server.TestServer({ 'port' : 9999, })
server.start()
pool = redis.ConnectionPool(**server.get_pool_args())
connection = redis.Redis(connection_pool=pool)
print connection.config_get()
server.stop()
```

The class is meant to be used in testsing and small application requiring a
stand alone redis server running.