locationlabs / mockredis

mock for redis-py (NO LONGER SUPPORTED)
Apache License 2.0
227 stars 107 forks source link

decode_responses=True doesn't work #97

Open pbecotte opened 8 years ago

pbecotte commented 8 years ago

Setting decode_responses on the client should cause the client to return strings instead of bytes objects in python 3.

Python 3.5.0 (default, Oct 24 2015, 09:48:42) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mockredis import mock_strict_redis_client
>>> 
>>> redis = mock_strict_redis_client(decode_responses=True)
>>> redis.set('yo', 'hello')
True
>>> redis.get('yo')
b'hello'
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from redis import StrictRedis
>>> r = StrictRedis('redis')
>>> r.set('yo', 'hello')
True
>>> r.get('yo')
b'hello'
>>> r = StrictRedis('redis', decode_responses=True)
>>> r.get('yo')
'hello'
JethroMV commented 5 years ago

Any update on getting this fixed?

richfromm commented 5 years ago

The project README was updated 2 months ago to indicate that this repo is no longer supported: https://github.com/locationlabs/mockredis/commit/1a8d82f44d217fc9c64143940a59f2f6af403fb8

If someone wants to take over managing this repo, feel free to fork it, and we can also update the README again to point to your fork.