{ "info": { "author": "James Saryerwinnie", "author_email": "js@jamesls.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "**This is a fork of ``fakeredis`` that supports Python 3.3 and doesn't break with ``rq``. When the fixes are merged to the main repository, this package will be removed.**\r\n\r\nfakeredis: A fake version of a redis-py\r\n=======================================\r\n\r\n.. image:: https://secure.travis-ci.org/jamesls/fakeredis.png?branch=master\r\n :target: http://travis-ci.org/jamesls/fakeredis\r\n\r\n.. image:: https://coveralls.io/repos/jamesls/fakeredis/badge.png?branch=master\r\n :target: https://coveralls.io/r/jamesls/fakeredis\r\n\r\n\r\nfakeredis is a pure python implementation of the redis-py python client\r\nthat simulates talking to a redis server. This was created for a single\r\npurpose: **to write unittests**. Setting up redis is not hard, but\r\nmany times you want to write unittests that do not talk to an external server\r\n(such as redis). This module now allows tests to simply use this\r\nmodule as a reasonable substitute for redis.\r\n\r\n\r\nHow to Use\r\n==========\r\n\r\nThe intent is for fakeredis to act as though you're talking to a real\r\nredis server. It does this by storing state in the fakeredis module.\r\nFor example::\r\n\r\n >>> import fakeredis\r\n >>> r = fakeredis.FakeStrictRedis()\r\n >>> r.set('foo', 'bar')\r\n True\r\n >>> r.get('foo')\r\n 'bar'\r\n >>> r.lpush('bar', 1)\r\n 1\r\n >>> r.lpush('bar', 2)\r\n 2\r\n >>> r.lrange('bar', 0, -1)\r\n [2, 1]\r\n\r\nBy storing state in the fakeredis module, instances can share\r\ndata::\r\n\r\n >>> import fakeredis\r\n >>> r1 = fakeredis.FakeStrictRedis()\r\n >>> r1.set('foo', 'bar')\r\n True\r\n >>> r2 = fakeredis.FakeStrictRedis()\r\n >>> r2.get('foo')\r\n 'bar'\r\n >>> r2.set('bar', 'baz')\r\n True\r\n >>> r1.get('bar')\r\n 'baz'\r\n >>> r2.get('bar')\r\n 'baz'\r\n\r\n\r\nFakeredis implements the same interface as `redis-py`_, the\r\npopular redis client for python, and models the responses\r\nof redis 2.6.\r\n\r\n\r\nUnimplemented Commands\r\n======================\r\n\r\nAll of the redis commands are implemented in fakeredis with\r\nthese exceptions:\r\n\r\n\r\nhash\r\n----\r\n\r\n * hincrbyfloat\r\n\r\n\r\nstring\r\n------\r\n\r\n * incrbyfloat\r\n * bitop\r\n * psetex\r\n\r\n\r\ngeneric\r\n-------\r\n\r\n * restore\r\n * dump\r\n * pexpireat\r\n * pttl\r\n * pexpire\r\n * migrate\r\n * object\r\n\r\n\r\nserver\r\n------\r\n\r\n * debug object\r\n * client list\r\n * lastsave\r\n * slowlog\r\n * sync\r\n * shutdown\r\n * monitor\r\n * client kill\r\n * config resetstat\r\n * time\r\n * config get\r\n * save\r\n * debug segfault\r\n * bgsave\r\n * bgrewriteaof\r\n * slaveof\r\n * info\r\n * config set\r\n * dbsize\r\n\r\n\r\nconnection\r\n----------\r\n\r\n * echo\r\n * select\r\n * quit\r\n * auth\r\n\r\n\r\nscripting\r\n---------\r\n\r\n * script flush\r\n * script kill\r\n * script load\r\n * evalsha\r\n * eval\r\n * script exists\r\n\r\n\r\npubsub\r\n------\r\n\r\n * punsubscribe\r\n * subscribe\r\n * publish\r\n * psubscribe\r\n * unsubscribe\r\n\r\n\r\nContributing\r\n============\r\n\r\nContributions are welcome. Please see the `contributing guide`_ for\r\nmore details.\r\n\r\n\r\nRunning the Tests\r\n=================\r\n\r\nTo ensure parity with the real redis, there are a set of integration tests\r\nthat mirror the unittests. For every unittest that is written, the same\r\ntest is run against a real redis instance using a real redis-py client\r\ninstance. In order to run these tests you must have a redis server running\r\non localhost, port 6379 (the default settings). The integration tests use\r\ndb=10 in order to minimize collisions with an existing redis instance.\r\n\r\n\r\nTo run all the tests, install the requirements file::\r\n\r\n pip install -r requirements.txt\r\n\r\nIf you just want to run the unittests::\r\n\r\n nosetests test_fakeredis.py:TestFakeStrictRedis test_fakeredis.py:TestFakeRedis\r\n\r\nBecause this module is attempting to provide the same interface as `redis-py`_,\r\nthe python bindings to redis, a reasonable way to test this to to take each\r\nunittest and run it against a real redis server. fakeredis and the real redis\r\nserver should give the same result. This ensures parity between the two. You\r\ncan run these \"integration\" tests like this::\r\n\r\n nosetests test_fakeredis.py:TestRealStrictRedis test_fakeredis.py:TestRealRedis\r\n\r\nIn terms of implementation, ``TestRealRedis`` is a subclass of\r\n``TestFakeRedis`` that overrides a factory method to create\r\nan instance of ``redis.Redis`` (an actual python client for redis)\r\ninstead of ``fakeredis.FakeStrictRedis``.\r\n\r\nTo run both the unittests and the \"integration\" tests, run::\r\n\r\n nosetests\r\n\r\nIf redis is not running and you try to run tests against a real redis server,\r\nthese tests will have a result of 'S' for skipped.\r\n\r\nThere are some tests that test redis blocking operations that are somewhat\r\nslow. If you want to skip these tests during day to day development,\r\nthey have all been tagged as 'slow' so you can skip them by running::\r\n\r\n nosetests -a '!slow'\r\n\r\n\r\n.. _redis-py: http://redis-py.readthedocs.org/en/latest/index.html\r\n.. _contributing guide: https://github.com/jamesls/fakeredis/blob/master/CONTRIBUTING.rst", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/clee704/fakeredis/tree/abc7160c5bbf5673c8831c61ae1afcc700737784", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "fakeredis-fix", "package_url": "https://pypi.org/project/fakeredis-fix/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/fakeredis-fix/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/clee704/fakeredis/tree/abc7160c5bbf5673c8831c61ae1afcc700737784" }, "release_url": "https://pypi.org/project/fakeredis-fix/0.4.1/", "requires_dist": null, "requires_python": null, "summary": "Fake implementation of redis API for testing purposes.", "version": "0.4.1" }, "last_serial": 989494, "releases": { "0.4.1": [ { "comment_text": "", "digests": { "md5": "a1ebfd0921f26b55ae7cbd9018ca7be4", "sha256": "fa155f96017772abf093a6bd930fc9be06f2b1a836a639313feaf637f74686d1" }, "downloads": -1, "filename": "fakeredis-fix-0.4.1.tar.gz", "has_sig": false, "md5_digest": "a1ebfd0921f26b55ae7cbd9018ca7be4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13328, "upload_time": "2014-02-03T15:42:59", "url": "https://files.pythonhosted.org/packages/16/a9/9b9552aebb90d2f3a890c6cf5be017385c3cd354e8331d9f4de3c0c6f4ca/fakeredis-fix-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a1ebfd0921f26b55ae7cbd9018ca7be4", "sha256": "fa155f96017772abf093a6bd930fc9be06f2b1a836a639313feaf637f74686d1" }, "downloads": -1, "filename": "fakeredis-fix-0.4.1.tar.gz", "has_sig": false, "md5_digest": "a1ebfd0921f26b55ae7cbd9018ca7be4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13328, "upload_time": "2014-02-03T15:42:59", "url": "https://files.pythonhosted.org/packages/16/a9/9b9552aebb90d2f3a890c6cf5be017385c3cd354e8331d9f4de3c0c6f4ca/fakeredis-fix-0.4.1.tar.gz" } ] }