zapier/mockredis

Name: mockredis

Owner: Zapier

Description: mock for redis-py

Created: 2018-05-17 10:53:26.0

Updated: 2018-05-17 10:56:01.0

Pushed: 2018-05-17 10:55:59.0

Homepage: null

Size: 452

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Mock for the redis-py client library

Supports writing tests for code using the redis-py library without requiring a redis-server install.

Build Status

Installation

Use pip:

pip install mockredispy
Usage

Both mockredis.mock_redis_client and mockredis.mock_strict_redis_client can be used to patch instances of the redis client.

For example, using the mock library:

@patch('redis.Redis', mock_redis_client)

Or:

@patch('redis.StrictRedis', mock_strict_redis_client)
Testing

Many unit tests exist to verify correctness of mock functionality. In addition, most unit tests support testing against an actual redis-server instance to verify the tests against ground truth. See mockredis.tests.fixtures for more details and disclaimers.

Supported python versions
Attribution

This code is shamelessly derived from work by John DeRosa.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.