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

Function test_hpexpire_multiple_fields

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

Source from the content-addressed store, hash-verified

126
127@skip_if_server_version_lt("7.3.240")
128def test_hpexpire_multiple_fields(r):
129 r.delete("test:hash")
130 r.hset(
131 "test:hash",
132 mapping={"field1": "value1", "field2": "value2", "field3": "value3"},
133 )
134 assert r.hpexpire("test:hash", 500, "field1", "field2") == [1, 1]
135 time.sleep(0.6)
136 assert r.hexists("test:hash", "field1") is False
137 assert r.hexists("test:hash", "field2") is False
138 assert r.hexists("test:hash", "field3") is True
139
140
141@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