Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix setbit #169

Merged
merged 1 commit into from
Mar 9, 2018
Merged

fix setbit #169

merged 1 commit into from
Mar 9, 2018

Conversation

cosven
Copy link
Contributor

@cosven cosven commented Nov 20, 2017

  1. setbit SHOULD return old_value instead of None
  2. there exists bug when setbit to 0

for example:

# originally
self.redis.setbit('foo', 4, 0)
value = self.redis.getbit('foo', 4)  # we will get 1, but we should get 0

1. setbit SHOULD return old_value instead of None
2. there exists bug when setbit to 0
@adamantike
Copy link
Contributor

I have experienced this same issue. The simplest scenario where current implementation fails is:

def test_getbit_zero(self):
    self.redis.setbit('foo', 1, 0)
    self.assertEqual(self.redis.getbit('foo', 1), 0)

@jamesls can you please consider merging this fix?

@jamesls jamesls merged commit 2589290 into jamesls:master Mar 9, 2018
@mrnovalles
Copy link

Could you release a patch version now that this fix is merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants