Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Update to match redis-py 2.10.6 #5

Closed
bmerry opened this issue Jan 19, 2018 · 0 comments · Fixed by #8
Closed

Update to match redis-py 2.10.6 #5

bmerry opened this issue Jan 19, 2018 · 0 comments · Fixed by #8
Assignees

Comments

@bmerry
Copy link

bmerry commented Jan 19, 2018

There are a few unit tests that fail when run against the latest redis-py (2.10.6):

======================================================================
ERROR: test_set_ex_should_expire_value (test_fakenewsredis.TestRealRedis)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/bmerry/work/sdp/git/fakenewsredis/test_fakenewsredis.py", line 3145, in test_set_ex_should_expire_value
    self.redis.set('foo', 'bar', ex=0)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/redis/client.py", line 1171, in set
    return self.execute_command('SET', *pieces)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/redis/client.py", line 668, in execute_command
    return self.parse_response(connection, command_name, **options)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/redis/client.py", line 680, in parse_response
    response = connection.read_response()
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/redis/connection.py", line 629, in read_response
    raise response
ResponseError: invalid expire time in set

======================================================================
ERROR: test_set_ex_should_expire_value (test_fakenewsredis.TestRealRedisDecodeResponses)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/bmerry/work/sdp/git/fakenewsredis/test_fakenewsredis.py", line 3145, in test_set_ex_should_expire_value
    self.redis.set('foo', 'bar', ex=0)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/redis/client.py", line 1171, in set
    return self.execute_command('SET', *pieces)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/redis/client.py", line 668, in execute_command
    return self.parse_response(connection, command_name, **options)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/redis/client.py", line 680, in parse_response
    response = connection.read_response()
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/redis/connection.py", line 629, in read_response
    raise response
ResponseError: invalid expire time in set

This is due to a change in how a zero expiry time is interpreted.

@bmerry bmerry self-assigned this Jan 24, 2018
bmerry added a commit that referenced this issue Jan 24, 2018
This fixes #5 (zero expiry time should be treated as invalid) and #7
(key should not be set when expiry time is invalid).
@bmerry bmerry closed this as completed in #8 Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant