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

Method test_get_set_bit

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

Source from the content-addressed store, hash-verified

1656 await r.getex("a", ex=0, px=1)
1657
1658 async def test_get_set_bit(self, r: redis.Redis):
1659 # no value
1660 assert not await r.getbit("a", 5)
1661 # set bit 5
1662 assert not await r.setbit("a", 5, True)
1663 assert await r.getbit("a", 5)
1664 # unset bit 4
1665 assert not await r.setbit("a", 4, False)
1666 assert not await r.getbit("a", 4)
1667 # set bit 4
1668 assert not await r.setbit("a", 4, True)
1669 assert await r.getbit("a", 4)
1670 # set bit 5 again
1671 assert await r.setbit("a", 5, True)
1672 assert await r.getbit("a", 5)
1673
1674 async def test_getrange(self, r: redis.Redis):
1675 await r.set("a", "foo")

Callers

nothing calls this directly

Calls 2

getbitMethod · 0.80
setbitMethod · 0.80

Tested by

no test coverage detected