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

Function test_tdigest_rank

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

Source from the content-addressed store, hash-verified

512@pytest.mark.experimental
513@pytest.mark.redismod
514async def test_tdigest_rank(decoded_r: redis.Redis):
515 assert await decoded_r.tdigest().create("t-digest", 500)
516 assert await decoded_r.tdigest().add("t-digest", list(range(0, 20)))
517 assert -1 == (await decoded_r.tdigest().rank("t-digest", -1))[0]
518 assert 0 == (await decoded_r.tdigest().rank("t-digest", 0))[0]
519 assert 10 == (await decoded_r.tdigest().rank("t-digest", 10))[0]
520 assert [-1, 20, 9] == await decoded_r.tdigest().rank("t-digest", -20, 20, 9)
521
522
523@pytest.mark.experimental

Callers

nothing calls this directly

Calls 4

rankMethod · 0.80
createMethod · 0.45
tdigestMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected