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

Method test_dump_and_restore_absttl

tests/test_commands.py:2009–2018  ·  view source on GitHub ↗
(self, r)

Source from the content-addressed store, hash-verified

2007
2008 @skip_if_server_version_lt("5.0.0")
2009 def test_dump_and_restore_absttl(self, r):
2010 r["a"] = "foo"
2011 dumped = r.dump("a")
2012 del r["a"]
2013 ttl = int(
2014 (redis_server_time(r) + datetime.timedelta(minutes=1)).timestamp() * 1000
2015 )
2016 r.restore("a", ttl, dumped, absttl=True)
2017 assert r["a"] == b"foo"
2018 assert 0 < r.ttl("a") <= 61
2019
2020 def test_exists(self, r):
2021 assert r.exists("a") == 0

Callers

nothing calls this directly

Calls 4

redis_server_timeFunction · 0.90
dumpMethod · 0.80
restoreMethod · 0.80
ttlMethod · 0.45

Tested by

no test coverage detected