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

Function test_hexpire_basic

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

Source from the content-addressed store, hash-verified

11
12@skip_if_server_version_lt("7.3.240")
13def test_hexpire_basic(r):
14 r.delete("test:hash")
15 r.hset("test:hash", mapping={"field1": "value1", "field2": "value2"})
16 assert r.hexpire("test:hash", 1, "field1") == [1]
17 time.sleep(1.1)
18 assert r.hexists("test:hash", "field1") is False
19 assert r.hexists("test:hash", "field2") is True
20
21
22@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