diff options
author | Alibi <aliby.bbb@gmail.com> | 2022-08-21 15:18:02 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-21 12:18:02 +0300 |
commit | 031b2087b57713d29b98140fb1f0b9f7b4fc7a21 (patch) | |
tree | 9426e49702885165479c2616b2cbce7b8207f521 /tests/test_commands.py | |
parent | e95b05a8df4d45d0c8186ac37f57d9edd9235820 (diff) | |
download | redis-py-031b2087b57713d29b98140fb1f0b9f7b4fc7a21.tar.gz |
Add BITFIELD_RO (#2340)
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r-- | tests/test_commands.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py index f9134d8..de8020c 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -4438,6 +4438,19 @@ class TestRedisCommands: ) assert resp == [0, None, 255] + @skip_if_server_version_lt("6.0.0") + def test_bitfield_ro(self, r: redis.Redis): + bf = r.bitfield("a") + resp = bf.set("u8", 8, 255).execute() + assert resp == [0] + + resp = r.bitfield_ro("a", "u8", 0) + assert resp == [0] + + items = [("u4", 8), ("u4", 12), ("u4", 13)] + resp = r.bitfield_ro("a", "u8", 0, items) + assert resp == [0, 15, 15, 14] + @skip_if_server_version_lt("4.0.0") def test_memory_help(self, r): with pytest.raises(NotImplementedError): |