/usr/lib/python3/dist-packages/fakeredis-0.8.2.egg-info/PKG-INFO is in python3-fakeredis 0.8.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | Metadata-Version: 1.1
Name: fakeredis
Version: 0.8.2
Summary: Fake implementation of redis API for testing purposes.
Home-page: https://github.com/jamesls/fakeredis
Author: James Saryerwinnie
Author-email: js@jamesls.com
License: BSD
Description: fakeredis: A fake version of a redis-py
=======================================
.. image:: https://secure.travis-ci.org/jamesls/fakeredis.png?branch=master
:target: http://travis-ci.org/jamesls/fakeredis
.. image:: https://coveralls.io/repos/jamesls/fakeredis/badge.png?branch=master
:target: https://coveralls.io/r/jamesls/fakeredis
fakeredis is a pure python implementation of the redis-py python client
that simulates talking to a redis server. This was created for a single
purpose: **to write unittests**. Setting up redis is not hard, but
many times you want to write unittests that do not talk to an external server
(such as redis). This module now allows tests to simply use this
module as a reasonable substitute for redis.
How to Use
==========
The intent is for fakeredis to act as though you're talking to a real
redis server. It does this by storing state in the fakeredis module.
For example:
.. code-block:: python
>>> import fakeredis
>>> r = fakeredis.FakeStrictRedis()
>>> r.set('foo', 'bar')
True
>>> r.get('foo')
'bar'
>>> r.lpush('bar', 1)
1
>>> r.lpush('bar', 2)
2
>>> r.lrange('bar', 0, -1)
[2, 1]
By storing state in the fakeredis module, instances can share
data:
.. code-block:: python
>>> import fakeredis
>>> r1 = fakeredis.FakeStrictRedis()
>>> r1.set('foo', 'bar')
True
>>> r2 = fakeredis.FakeStrictRedis()
>>> r2.get('foo')
'bar'
>>> r2.set('bar', 'baz')
True
>>> r1.get('bar')
'baz'
>>> r2.get('bar')
'baz'
Because fakeredis stores state at the module level, if you
want to ensure that you have a clean slate for every unit
test you run, be sure to call `r.flushall()` in your
``tearDown`` method. For example::
def setUp(self):
# Setup fake redis for testing.
self.r = fakeredis.FakeStrictRedis()
def tearDown(self):
# Clear data in fakeredis.
self.r.flushall()
Fakeredis implements the same interface as `redis-py`_, the
popular redis client for python, and models the responses
of redis 2.6.
Unimplemented Commands
======================
All of the redis commands are implemented in fakeredis with
these exceptions:
sorted_set
----------
* zscan
hash
----
* hstrlen
string
------
* bitop
* bitpos
geo
---
* geoadd
* geopos
* georadius
* geohash
* georadiusbymember
* geodist
generic
-------
* restore
* dump
* migrate
* object
* wait
server
------
* client list
* lastsave
* slowlog
* debug object
* shutdown
* debug segfault
* command count
* monitor
* client kill
* cluster slots
* role
* config resetstat
* time
* config get
* config set
* save
* client setname
* command getkeys
* config rewrite
* sync
* client getname
* bgrewriteaof
* slaveof
* info
* client pause
* bgsave
* command
* dbsize
* command info
cluster
-------
* cluster getkeysinslot
* cluster info
* readwrite
* cluster slots
* cluster keyslot
* cluster addslots
* readonly
* cluster saveconfig
* cluster forget
* cluster meet
* cluster slaves
* cluster nodes
* cluster countkeysinslot
* cluster setslot
* cluster count-failure-reports
* cluster reset
* cluster failover
* cluster set-config-epoch
* cluster delslots
* cluster replicate
connection
----------
* echo
* select
* quit
* auth
scripting
---------
* script flush
* script kill
* script load
* evalsha
* eval
* script exists
Contributing
============
Contributions are welcome. Please see the `contributing guide`_ for
more details.
If you'd like to help out, you can start with any of the issues
labeled with `HelpWanted`_.
Running the Tests
=================
To ensure parity with the real redis, there are a set of integration tests
that mirror the unittests. For every unittest that is written, the same
test is run against a real redis instance using a real redis-py client
instance. In order to run these tests you must have a redis server running
on localhost, port 6379 (the default settings). The integration tests use
db=10 in order to minimize collisions with an existing redis instance.
To run all the tests, install the requirements file::
pip install -r requirements.txt
If you just want to run the unittests::
nosetests test_fakeredis.py:TestFakeStrictRedis test_fakeredis.py:TestFakeRedis
Because this module is attempting to provide the same interface as `redis-py`_,
the python bindings to redis, a reasonable way to test this to to take each
unittest and run it against a real redis server. fakeredis and the real redis
server should give the same result. This ensures parity between the two. You
can run these "integration" tests like this::
nosetests test_fakeredis.py:TestRealStrictRedis test_fakeredis.py:TestRealRedis
In terms of implementation, ``TestRealRedis`` is a subclass of
``TestFakeRedis`` that overrides a factory method to create
an instance of ``redis.Redis`` (an actual python client for redis)
instead of ``fakeredis.FakeStrictRedis``.
To run both the unittests and the "integration" tests, run::
nosetests
If redis is not running and you try to run tests against a real redis server,
these tests will have a result of 'S' for skipped.
There are some tests that test redis blocking operations that are somewhat
slow. If you want to skip these tests during day to day development,
they have all been tagged as 'slow' so you can skip them by running::
nosetests -a '!slow'
.. _redis-py: http://redis-py.readthedocs.org/en/latest/index.html
.. _contributing guide: https://github.com/jamesls/fakeredis/blob/master/CONTRIBUTING.rst
.. _HelpWanted: https://github.com/jamesls/fakeredis/issues?q=is%3Aissue+is%3Aopen+label%3AHelpWanted
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: License :: OSI Approved :: BSD License
|