diff options
author | Konstantin Merenkov <kmerenkov@gmail.com> | 2010-08-13 00:48:50 +0800 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2010-08-17 06:44:35 +0800 |
commit | a12eb8c6d0d729852cafc1be17a6b22e9107946c (patch) | |
tree | 7886e3f56e2583378f87331ad64e1ae9fe886658 /tests/server_commands.py | |
parent | 37321e9abf8c01486d9a26e0687177c4f3cf1958 (diff) | |
download | redis-py-a12eb8c6d0d729852cafc1be17a6b22e9107946c.tar.gz |
New command: zcount
Diffstat (limited to 'tests/server_commands.py')
-rw-r--r-- | tests/server_commands.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/server_commands.py b/tests/server_commands.py index 81096e9..efcf2d6 100644 --- a/tests/server_commands.py +++ b/tests/server_commands.py @@ -615,6 +615,17 @@ class ServerCommandsTestCase(unittest.TestCase): self.make_zset('a', {'a1': 1, 'a2': 2, 'a3': 3}) self.assertEquals(self.client.zcard('a'), 3) + def test_zcount(self): + # key is not a zset + self.client['a'] = 'a' + self.assertRaises(redis.ResponseError, self.client.zcount, 'a', 0, 0) + del self.client['a'] + # real logic + self.make_zset('a', {'a1': 1, 'a2': 2, 'a3': 3}) + self.assertEquals(self.client.zcount('a', '-inf', '+inf'), 3) + self.assertEquals(self.client.zcount('a', 1, 2), 2) + self.assertEquals(self.client.zcount('a', 10, 20), 0) + def test_zincrby(self): # key is not a zset self.client['a'] = 'a' |