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

Function test_bf_add

tests/test_asyncio/test_bloom.py:45–54  ·  view source on GitHub ↗
(decoded_r: redis.Redis)

Source from the content-addressed store, hash-verified

43
44@pytest.mark.redismod
45async def test_bf_add(decoded_r: redis.Redis):
46 assert await decoded_r.bf().create("bloom", 0.01, 1000)
47 assert 1 == await decoded_r.bf().add("bloom", "foo")
48 assert 0 == await decoded_r.bf().add("bloom", "foo")
49 assert [0] == intlist(await decoded_r.bf().madd("bloom", "foo"))
50 assert [0, 1] == await decoded_r.bf().madd("bloom", "foo", "bar")
51 assert [0, 0, 1] == await decoded_r.bf().madd("bloom", "foo", "bar", "baz")
52 assert 1 == await decoded_r.bf().exists("bloom", "foo")
53 assert 0 == await decoded_r.bf().exists("bloom", "noexist")
54 assert [1, 0] == intlist(await decoded_r.bf().mexists("bloom", "foo", "noexist"))
55
56
57@pytest.mark.redismod

Callers

nothing calls this directly

Calls 7

intlistFunction · 0.70
createMethod · 0.45
bfMethod · 0.45
addMethod · 0.45
maddMethod · 0.45
existsMethod · 0.45
mexistsMethod · 0.45

Tested by

no test coverage detected