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

Function test_hexpire_basic

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

Source from the content-addressed store, hash-verified

12
13@skip_if_server_version_lt("7.3.240")
14async def test_hexpire_basic(r):
15 await r.delete("test:hash")
16 await r.hset("test:hash", mapping={"field1": "value1", "field2": "value2"})
17 assert await r.hexpire("test:hash", 1, "field1") == [1]
18 await asyncio.sleep(1.1)
19 assert await r.hexists("test:hash", "field1") is False
20 assert await r.hexists("test:hash", "field2") is True
21
22
23@skip_if_server_version_lt("7.3.240")

Callers

nothing calls this directly

Calls 5

hsetMethod · 0.80
hexpireMethod · 0.80
hexistsMethod · 0.80
deleteMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected