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

Function test_cms_merge

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

Source from the content-addressed store, hash-verified

254@pytest.mark.onlynoncluster
255@pytest.mark.redismod
256async def test_cms_merge(decoded_r: redis.Redis):
257 assert await decoded_r.cms().initbydim("A", 1000, 5)
258 assert await decoded_r.cms().initbydim("B", 1000, 5)
259 assert await decoded_r.cms().initbydim("C", 1000, 5)
260 assert await decoded_r.cms().incrby("A", ["foo", "bar", "baz"], [5, 3, 9])
261 assert await decoded_r.cms().incrby("B", ["foo", "bar", "baz"], [2, 3, 1])
262 assert [5, 3, 9] == await decoded_r.cms().query("A", "foo", "bar", "baz")
263 assert [2, 3, 1] == await decoded_r.cms().query("B", "foo", "bar", "baz")
264 assert await decoded_r.cms().merge("C", 2, ["A", "B"])
265 assert [7, 6, 10] == await decoded_r.cms().query("C", "foo", "bar", "baz")
266 assert await decoded_r.cms().merge("C", 2, ["A", "B"], ["1", "2"])
267 assert [9, 9, 11] == await decoded_r.cms().query("C", "foo", "bar", "baz")
268 assert await decoded_r.cms().merge("C", 2, ["A", "B"], ["2", "3"])
269 assert [16, 15, 21] == await decoded_r.cms().query("C", "foo", "bar", "baz")
270
271
272@pytest.mark.redismod

Callers

nothing calls this directly

Calls 5

initbydimMethod · 0.80
cmsMethod · 0.45
incrbyMethod · 0.45
queryMethod · 0.45
mergeMethod · 0.45

Tested by

no test coverage detected