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

Method test_zscan

tests/test_asyncio/test_commands.py:3294–3306  ·  view source on GitHub ↗
(self, r: redis.Redis)

Source from the content-addressed store, hash-verified

3292
3293 @skip_if_server_version_lt("2.8.0")
3294 async def test_zscan(self, r: redis.Redis):
3295 await r.zadd("a", {"a": 1, "b": 2, "c": 3})
3296 cursor, pairs = await r.zscan("a")
3297 assert cursor == 0
3298 if expects_unified_shape(r):
3299 assert sorted(pairs) == [[b"a", 1.0], [b"b", 2.0], [b"c", 3.0]]
3300 else:
3301 assert set(pairs) == {(b"a", 1), (b"b", 2), (b"c", 3)}
3302 _, pairs = await r.zscan("a", match="a")
3303 if expects_unified_shape(r):
3304 assert pairs == [[b"a", 1.0]]
3305 else:
3306 assert set(pairs) == {(b"a", 1)}
3307
3308 @skip_if_server_version_lt("2.8.0")
3309 async def test_zscan_iter(self, r: redis.Redis):

Callers

nothing calls this directly

Calls 3

expects_unified_shapeFunction · 0.90
zaddMethod · 0.80
zscanMethod · 0.80

Tested by

no test coverage detected