Skip to content
Permalink
Browse files

fix order of zincrby args to match redis server

fixes #571
  • Loading branch information
andymccurdy committed Nov 14, 2018
1 parent 36a84fc commit a750c7946d41862a38955c35b6928f098911c406
Showing with 4 additions and 4 deletions.
  1. +1 −1 redis/client.py
  2. +2 −2 tests/test_commands.py
  3. +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() == \
[

0 comments on commit a750c79

Please sign in to comment.
You can’t perform that action at this time.