| 237 | |
| 238 | @pytest.mark.redismod |
| 239 | async 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 |