summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2018-11-14 12:29:14 -0800
committerAndy McCurdy <andy@andymccurdy.com>2018-11-14 12:29:14 -0800
commita750c7946d41862a38955c35b6928f098911c406 (patch)
tree88146d5e17f8019d4118adc5a4b4f239745ffdde
parent36a84fc9ac4e06a9b85ccc4e4eda426b387c7093 (diff)
downloadredis-py-a750c7946d41862a38955c35b6928f098911c406.tar.gz
fix order of zincrby args to match redis server
fixes #571
-rwxr-xr-xredis/client.py2
-rw-r--r--tests/test_commands.py4
-rw-r--r--tests/test_pipeline.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/redis/client.py b/redis/client.py
index 9a508cd..1f6e623 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -2226,7 +2226,7 @@ class Redis(object):
"""
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)
diff --git a/tests/test_commands.py b/tests/test_commands.py
index 1363d8d..ade8ecc 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -993,8 +993,8 @@ class TestRedisCommands(object):
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
diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py
index 9487a42..2e2507a 100644
--- a/tests/test_pipeline.py
+++ b/tests/test_pipeline.py
@@ -12,7 +12,7 @@ class TestPipeline(object):
.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() == \
[