Skip to content

MockRedis doesn't handle integer values the same as Redis does. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
slacy opened this issue Aug 25, 2012 · 0 comments
Open

MockRedis doesn't handle integer values the same as Redis does. #2

slacy opened this issue Aug 25, 2012 · 0 comments

Comments

@slacy
Copy link

slacy commented Aug 25, 2012

Here's some example code:

from mockredis import MockRedis 
from redis import Redis 

real_redis = Redis() 
mock_redis = MockRedis()

real_redis.hset('answer', 'ultimate', 42)
mock_redis.hset('answer', 'ultimate', 42)

assert(real_redis.hget('answer', 'ultimate') == mock_redis.hget('answer', 'ultimate'))

mock_redis returns the integer 42, and real_redis returns the string '42', since everything in Redis is a string.

MockRedis should convert all values to strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant