MCPcopy
hub / github.com/redis/redis-py / test_bitcount

Method test_bitcount

tests/test_asyncio/test_commands.py:1155–1171  ·  view source on GitHub ↗
(self, r: redis.Redis)

Source from the content-addressed store, hash-verified

1153
1154 @skip_if_server_version_lt("2.6.0")
1155 async def test_bitcount(self, r: redis.Redis):
1156 await r.setbit("a", 5, True)
1157 assert await r.bitcount("a") == 1
1158 await r.setbit("a", 6, True)
1159 assert await r.bitcount("a") == 2
1160 await r.setbit("a", 5, False)
1161 assert await r.bitcount("a") == 1
1162 await r.setbit("a", 9, True)
1163 await r.setbit("a", 17, True)
1164 await r.setbit("a", 25, True)
1165 await r.setbit("a", 33, True)
1166 assert await r.bitcount("a") == 5
1167 assert await r.bitcount("a", 0, -1) == 5
1168 assert await r.bitcount("a", 2, 3) == 2
1169 assert await r.bitcount("a", 2, -1) == 3
1170 assert await r.bitcount("a", -2, -1) == 2
1171 assert await r.bitcount("a", 1, 1) == 1
1172
1173 @skip_if_server_version_lt("2.6.0")
1174 @pytest.mark.onlynoncluster

Callers

nothing calls this directly

Calls 2

setbitMethod · 0.80
bitcountMethod · 0.80

Tested by

no test coverage detected