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

Function test_hexpireat_basic

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

Source from the content-addressed store, hash-verified

149
150@skip_if_server_version_lt("7.3.240")
151def test_hexpireat_basic(r):
152 r.delete("test:hash")
153 r.hset("test:hash", mapping={"field1": "value1", "field2": "value2"})
154 exp_time = math.ceil((datetime.now() + timedelta(seconds=1)).timestamp())
155 assert r.hexpireat("test:hash", exp_time, "field1") == [1]
156 time.sleep(2.1)
157 assert r.hexists("test:hash", "field1") is False
158 assert r.hexists("test:hash", "field2") is True
159
160
161@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