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

Function test_hpexpire_basic

tests/test_asyncio/test_hash.py:74–80  ·  view source on GitHub ↗
(r)

Source from the content-addressed store, hash-verified

72
73@skip_if_server_version_lt("7.3.240")
74async def test_hpexpire_basic(r):
75 await r.delete("test:hash")
76 await r.hset("test:hash", mapping={"field1": "value1", "field2": "value2"})
77 assert await r.hpexpire("test:hash", 500, "field1") == [1]
78 await asyncio.sleep(0.6)
79 assert await r.hexists("test:hash", "field1") is False
80 assert await r.hexists("test:hash", "field2") is True
81
82
83@skip_if_server_version_lt("7.3.240")

Callers

nothing calls this directly

Calls 5

hsetMethod · 0.80
hpexpireMethod · 0.80
hexistsMethod · 0.80
deleteMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected