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

Function test_revrange_bucket_timestamp

tests/test_timeseries.py:477–506  ·  view source on GitHub ↗
(client: redis.Redis)

Source from the content-addressed store, hash-verified

475@pytest.mark.redismod
476@skip_ifmodversion_lt("1.8.0", "timeseries")
477def test_revrange_bucket_timestamp(client: redis.Redis):
478 timeseries = client.ts()
479 timeseries.create("t1")
480 timeseries.add("t1", 15, 1)
481 timeseries.add("t1", 17, 4)
482 timeseries.add("t1", 51, 3)
483 timeseries.add("t1", 73, 5)
484 timeseries.add("t1", 75, 3)
485 assert_resp_response(
486 client,
487 timeseries.revrange(
488 "t1", 0, 100, align=0, aggregation_type="max", bucket_size_msec=10
489 ),
490 [(70, 5.0), (50, 3.0), (10, 4.0)],
491 [[70, 5.0], [50, 3.0], [10, 4.0]],
492 )
493 assert_resp_response(
494 client,
495 timeseries.range(
496 "t1",
497 0,
498 100,
499 align=0,
500 aggregation_type="max",
501 bucket_size_msec=10,
502 bucket_timestamp="+",
503 ),
504 [(20, 4.0), (60, 3.0), (80, 5.0)],
505 [[20, 4.0], [60, 3.0], [80, 5.0]],
506 )
507
508
509@pytest.mark.redismod

Callers

nothing calls this directly

Calls 6

assert_resp_responseFunction · 0.85
revrangeMethod · 0.80
rangeMethod · 0.80
tsMethod · 0.45
createMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected