Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jettify committed Jun 21, 2014
1 parent a21987f commit b993b32
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,20 @@ def test_bitop_string_operands(self, r):
@skip_if_server_version_lt('2.8.7')
def test_bitpos(self, r):
key = 'key:bitpos'
r.set(key, '\xff\xf0\x00')
r.set(key, b('\xff\xf0\x00'))
assert r.bitpos(key, 0) == 12
assert r.bitpos(key, 0, 2, -1) == 16
assert r.bitpos(key, 0, -2, -1) == 12
r.set(key, '\x00\xff\xf0')
r.set(key, b('\x00\xff\xf0'))
assert r.bitpos(key, 1, 0) == 8
assert r.bitpos(key, 1, 1) == 8
r.set(key, '\x00\x00\x00')
r.set(key, b('\x00\x00\x00'))
assert r.bitpos(key, 1) == -1

@skip_if_server_version_lt('2.8.7')
def test_bitpos_wrong_arguments(self, r):
key = 'key:bitpos:wrong:args'
r.set(key, '\xff\xf0\x00')
r.set(key, b('\xff\xf0\x00'))
with pytest.raises(exceptions.RedisError):
r.bitpos(key, 0, end=1) == 12
with pytest.raises(exceptions.RedisError):
Expand Down

0 comments on commit b993b32

Please sign in to comment.