Skip to content
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

Allow range arguments to come as string. #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amotzg
Copy link
Contributor

@amotzg amotzg commented Jun 23, 2016

MockRedis._translate_range() assumed start and end to be integers but Redis use string for arguments.
Using commands with string range arguments caused errors.
e.g.:
mock_redis.zrange('myzset', '0', '-1') # Always return an empty list before the fix.

@@ -1444,6 +1444,8 @@ def _translate_range(self, len_, start, end):
"""
Translate range to valid bounds.
"""
start = int(start)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test to cover this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added tester for client.py translation functions.
See comment about general test failure below.

@amotzg
Copy link
Contributor Author

amotzg commented Dec 4, 2016

Checks for this PR fails due to a general problem in Travis YAML configuration.
The following PR solves this #114

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

Successfully merging this pull request may close these issues.

2 participants