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

Function test_hpexpire_with_timedelta

tests/test_hash.py:92–98  ·  view source on GitHub ↗
(r)

Source from the content-addressed store, hash-verified

90
91@skip_if_server_version_lt("7.3.240")
92def test_hpexpire_with_timedelta(r):
93 r.delete("test:hash")
94 r.hset("test:hash", mapping={"field1": "value1", "field2": "value2"})
95 assert r.hpexpire("test:hash", timedelta(milliseconds=500), "field1") == [1]
96 time.sleep(0.6)
97 assert r.hexists("test:hash", "field1") is False
98 assert r.hexists("test:hash", "field2") is True
99
100
101@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