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

Method test_scan

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

Source from the content-addressed store, hash-verified

3200 @skip_if_server_version_lt("2.8.0")
3201 @pytest.mark.onlynoncluster
3202 async def test_scan(self, r: redis.Redis):
3203 await r.set("a", 1)
3204 await r.set("b", 2)
3205 await r.set("c", 3)
3206 cursor, keys = await r.scan()
3207 assert cursor == 0
3208 assert set(keys) == {b"a", b"b", b"c"}
3209 _, keys = await r.scan(match="a")
3210 assert set(keys) == {b"a"}
3211
3212 @skip_if_server_version_lt(REDIS_6_VERSION)
3213 @pytest.mark.onlynoncluster

Callers

nothing calls this directly

Calls 2

scanMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected