diff options
author | andy <andy@whiskeymedia.com> | 2011-07-11 01:20:48 -0700 |
---|---|---|
committer | andy <andy@whiskeymedia.com> | 2011-07-11 01:20:48 -0700 |
commit | 37fb01edf06673cd56421497128daee3fafbd2d9 (patch) | |
tree | 44cb0f77cd61fdefc3f9323e2d7dd0e6661059cc /tests/server_commands.py | |
parent | 53c928d44acd3d1fbcb3896cadad0bde4671987a (diff) | |
parent | be1e7498ff195681f1cf760b764d657161715968 (diff) | |
download | redis-py-37fb01edf06673cd56421497128daee3fafbd2d9.tar.gz |
Merge branch 'master' into watch
Conflicts:
CHANGES
Diffstat (limited to 'tests/server_commands.py')
-rw-r--r-- | tests/server_commands.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/server_commands.py b/tests/server_commands.py index b106126..9e3375d 100644 --- a/tests/server_commands.py +++ b/tests/server_commands.py @@ -770,7 +770,6 @@ class ServerCommandsTestCase(unittest.TestCase): [('a3', 20), ('a1', 23)] ) - def test_zrange(self): # key is not a zset self.client['a'] = 'a' @@ -784,10 +783,13 @@ class ServerCommandsTestCase(unittest.TestCase): [('a1', 1.0), ('a2', 2.0)]) self.assertEquals(self.client.zrange('a', 1, 2, withscores=True), [('a2', 2.0), ('a3', 3.0)]) + # test a custom score casting function returns the correct value + self.assertEquals( + self.client.zrange('a', 0, 1, withscores=True, score_cast_func=int), + [('a1', 1), ('a2', 2)]) # a non existant key should return empty list self.assertEquals(self.client.zrange('b', 0, 1, withscores=True), []) - def test_zrangebyscore(self): # key is not a zset self.client['a'] = 'a' |