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

Function test_cms

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

Source from the content-addressed store, hash-verified

237
238@pytest.mark.redismod
239async def test_cms(decoded_r: redis.Redis):
240 assert await decoded_r.cms().initbydim("dim", 1000, 5)
241 assert await decoded_r.cms().initbyprob("prob", 0.01, 0.01)
242 assert await decoded_r.cms().incrby("dim", ["foo"], [5])
243 assert [0] == await decoded_r.cms().query("dim", "notexist")
244 assert [5] == await decoded_r.cms().query("dim", "foo")
245 assert [10, 15] == await decoded_r.cms().incrby("dim", ["foo", "bar"], [5, 15])
246 assert [10, 15] == await decoded_r.cms().query("dim", "foo", "bar")
247 info = await decoded_r.cms().info("dim")
248 assert info["width"]
249 assert 1000 == info["width"]
250 assert 5 == info["depth"]
251 assert 25 == info["count"]
252
253
254@pytest.mark.onlynoncluster

Callers

nothing calls this directly

Calls 6

initbydimMethod · 0.80
initbyprobMethod · 0.80
cmsMethod · 0.45
incrbyMethod · 0.45
queryMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected