Giter VIP home page Giter VIP logo

mockredis's Introduction

Mock for the redis-py client library

Build Status License

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

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

  • Python 2.7
  • Python 3.2
  • Python 3.3
  • Python 3.4
  • PyPy
  • PyPy3

Attribution

This code is shamelessly derived from work by John DeRosa.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.