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

Function test_hexpireat_with_datetime

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

Source from the content-addressed store, hash-verified

160
161@skip_if_server_version_lt("7.3.240")
162def test_hexpireat_with_datetime(r):
163 r.delete("test:hash")
164 r.hset("test:hash", mapping={"field1": "value1", "field2": "value2"})
165 exp_time = (datetime.now() + timedelta(seconds=2)).replace(microsecond=0)
166 assert r.hexpireat("test:hash", exp_time, "field1") == [1]
167 time.sleep(2.1)
168 assert r.hexists("test:hash", "field1") is False
169 assert r.hexists("test:hash", "field2") is True
170
171
172@skip_if_server_version_lt("7.3.240")

Callers

nothing calls this directly

Calls 5

hsetMethod · 0.80
hexpireatMethod · 0.80
hexistsMethod · 0.80
deleteMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected