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

Function test_hexpire_with_timedelta

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

Source from the content-addressed store, hash-verified

22
23@skip_if_server_version_lt("7.3.240")
24async def test_hexpire_with_timedelta(r):
25 await r.delete("test:hash")
26 await r.hset("test:hash", mapping={"field1": "value1", "field2": "value2"})
27 assert await r.hexpire("test:hash", timedelta(seconds=1), "field1") == [1]
28 await asyncio.sleep(1.1)
29 assert await r.hexists("test:hash", "field1") is False
30 assert await r.hexists("test:hash", "field2") is True
31
32
33@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