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

Function test_hexpireat_with_datetime

tests/test_asyncio/test_hash.py:145–152  ·  view source on GitHub ↗
(r)

Source from the content-addressed store, hash-verified

143
144@skip_if_server_version_lt("7.3.240")
145async def test_hexpireat_with_datetime(r):
146 await r.delete("test:hash")
147 await r.hset("test:hash", mapping={"field1": "value1", "field2": "value2"})
148 exp_time = (datetime.now() + timedelta(seconds=2)).replace(microsecond=0)
149 assert await r.hexpireat("test:hash", exp_time, "field1") == [1]
150 await asyncio.sleep(2.1)
151 assert await r.hexists("test:hash", "field1") is False
152 assert await r.hexists("test:hash", "field2") is True
153
154
155@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