Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Nov 23, 2023
1 parent 887cd18 commit cf5df23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion fakeredis/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,3 @@ class FakeStrictRedis(FakeRedisMixin, redis.StrictRedis):

class FakeRedis(FakeRedisMixin, redis.Redis):
pass

9 changes: 4 additions & 5 deletions test/test_mixins/test_bitmap_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ def test_bitfield_set_sat(r: redis.Redis):
assert r.get(key) == b"\x77\xf5\x00"
assert r.bitfield(key, 'SAT').set('i4', 4, -8).set('i4', 0, -9).execute() == [7, 7]
assert r.get(key) == b"\x88\xf5\x00"
assert r.bitfield(key, 'SAT').set('i60', 0, -(1 << 62)+1).execute() == [0x88f5000_00000000-(1 << 60)]
assert r.bitfield(key, 'SAT').set('i60', 0, -(1 << 62) + 1).execute() == [0x88f5000_00000000 - (1 << 60)]
assert r.get(key) == b"\x80" + b"\0" * 7
assert r.bitfield(key, 'SAT').set('u60', 0, -(1 << 63)+1).execute() == [1 << 59]
assert r.bitfield(key, 'SAT').set('u60', 0, -(1 << 63) + 1).execute() == [1 << 59]
assert r.get(key) == b"\xff" * 7 + b"\xf0"


Expand Down Expand Up @@ -339,9 +339,9 @@ def test_bitfield_incr_sat(r: redis.Redis):
assert r.get(key) == b"\x76\xef\x00"
assert r.bitfield(key, 'SAT').incrby('i4', 4, -8).incrby('i4', 0, -9).execute() == [-2, -2]
assert r.get(key) == b"\xee\xef\x00"
assert r.bitfield(key, 'SAT').incrby('i60', 0, -(1 << 62)+1).execute() == [-(1 << 59)]
assert r.bitfield(key, 'SAT').incrby('i60', 0, -(1 << 62) + 1).execute() == [-(1 << 59)]
assert r.get(key) == b"\x80" + b"\0" * 7
assert r.bitfield(key, 'SAT').set('u60', 0, -(1 << 63)+1).execute() == [1 << 59]
assert r.bitfield(key, 'SAT').set('u60', 0, -(1 << 63) + 1).execute() == [1 << 59]
assert r.get(key) == b"\xff" * 7 + b"\xf0"


Expand Down Expand Up @@ -386,4 +386,3 @@ def test_bitfield_set_wrong_arguments(r: redis.Redis):
for encoding in ('I8', 'i-42', 'i5?', 'u0', 'i0', 'i65', 'u64', 'i 60'):
with pytest.raises(redis.ResponseError):
raw_command(r, 'bitfield', key, 'set', encoding, 0, 0)

0 comments on commit cf5df23

Please sign in to comment.