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

Function test_hpexpire_with_timedelta

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

Source from the content-addressed store, hash-verified

82
83@skip_if_server_version_lt("7.3.240")
84async def test_hpexpire_with_timedelta(r):
85 await r.delete("test:hash")
86 await r.hset("test:hash", mapping={"field1": "value1", "field2": "value2"})
87 assert await r.hpexpire("test:hash", timedelta(milliseconds=500), "field1") == [1]
88 await asyncio.sleep(0.6)
89 assert await r.hexists("test:hash", "field1") is False
90 assert await r.hexists("test:hash", "field2") is True
91
92
93@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