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

Function test_cms_merge

tests/test_bloom.py:288–301  ·  view source on GitHub ↗
(client)

Source from the content-addressed store, hash-verified

286@pytest.mark.onlynoncluster
287@pytest.mark.redismod
288def test_cms_merge(client):
289 assert client.cms().initbydim("A", 1000, 5)
290 assert client.cms().initbydim("B", 1000, 5)
291 assert client.cms().initbydim("C", 1000, 5)
292 assert client.cms().incrby("A", ["foo", "bar", "baz"], [5, 3, 9])
293 assert client.cms().incrby("B", ["foo", "bar", "baz"], [2, 3, 1])
294 assert [5, 3, 9] == client.cms().query("A", "foo", "bar", "baz")
295 assert [2, 3, 1] == client.cms().query("B", "foo", "bar", "baz")
296 assert client.cms().merge("C", 2, ["A", "B"])
297 assert [7, 6, 10] == client.cms().query("C", "foo", "bar", "baz")
298 assert client.cms().merge("C", 2, ["A", "B"], ["1", "2"])
299 assert [9, 9, 11] == client.cms().query("C", "foo", "bar", "baz")
300 assert client.cms().merge("C", 2, ["A", "B"], ["2", "3"])
301 assert [16, 15, 21] == client.cms().query("C", "foo", "bar", "baz")
302
303
304@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