Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix order of zincrby args to match redis server
- Loading branch information
Showing
with
4 additions
and
4 deletions.
-
+1
−1
redis/client.py
-
+2
−2
tests/test_commands.py
-
+1
−1
tests/test_pipeline.py
|
@@ -2226,7 +2226,7 @@ def zcount(self, name, min, max): |
|
|
""" |
|
|
return self.execute_command('ZCOUNT', name, min, max) |
|
|
|
|
|
def zincrby(self, name, value, amount=1): |
|
|
def zincrby(self, name, amount, value): |
|
|
"Increment the score of ``value`` in sorted set ``name`` by ``amount``" |
|
|
return self.execute_command('ZINCRBY', name, amount, value) |
|
|
|
|
|
|
@@ -993,8 +993,8 @@ def test_zcount(self, r): |
|
|
|
|
|
def test_zincrby(self, r): |
|
|
r.zadd('a', {'a1': 1, 'a2': 2, 'a3': 3}) |
|
|
assert r.zincrby('a', 'a2') == 3.0 |
|
|
assert r.zincrby('a', 'a3', amount=5) == 8.0 |
|
|
assert r.zincrby('a', 1, 'a2') == 3.0 |
|
|
assert r.zincrby('a', 5, 'a3') == 8.0 |
|
|
assert r.zscore('a', 'a2') == 3.0 |
|
|
assert r.zscore('a', 'a3') == 8.0 |
|
|
|
|
|
|
@@ -12,7 +12,7 @@ def test_pipeline(self, r): |
|
|
.get('a') |
|
|
.zadd('z', {'z1': 1}) |
|
|
.zadd('z', {'z2': 4}) |
|
|
.zincrby('z', 'z1') |
|
|
.zincrby('z', 1, 'z1') |
|
|
.zrange('z', 0, 5, withscores=True)) |
|
|
assert pipe.execute() == \ |
|
|
[ |
|
|