Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@guigen
Copy link

@guigen guigen commented Jan 13, 2018

Allows to pass a function to cast the score return value.

@guigen guigen force-pushed the add-score-cast-func-support branch from 757d989 to a8daf9a Compare January 13, 2018 13:52
@guigen guigen force-pushed the add-score-cast-func-support branch from a8daf9a to 98d1369 Compare January 13, 2018 16:08
Copy link
Collaborator

@bmerry bmerry left a comment

Choose a reason for hiding this comment

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

This looks like a good start, thanks. It also needs to be added to zrange and zrevrange.

self.redis.zadd('foo', three=3)
self.assertEqual(self.redis.zrangebyscore('foo', 1, 3, 0, 2, True,
int),
[(b'one', 1), (b'two', 2)])
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not an effective test, because it passes even if the score_cast_func isn't being applied. Rather use str as the cast func.

int),
[(b'one', 1), (b'two', 2)])

def test_zrevrangebyscore(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a test for zrevrangebyscore with score_cast_func as well.

@bmerry
Copy link
Collaborator

bmerry commented Jun 21, 2018

Closing in favour of #194.

@bmerry bmerry closed this Jun 21, 2018
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