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

Method test_increx_expiration_enx

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

Source from the content-addressed store, hash-verified

2354
2355 @skip_if_server_version_lt("8.7.0")
2356 def test_increx_expiration_enx(self, r):
2357 key = "increx:expiration"
2358 assert r.set(key, 40)
2359 assert r.ttl(key) == -1
2360
2361 assert r.increx(key, byint=2, ex=60, enx=True) == [42, 2]
2362 ttl = r.ttl(key)
2363 assert 0 < ttl <= 60
2364
2365 assert r.increx(key, byint=3, ex=600, enx=True) == [45, 3]
2366 assert 0 < r.ttl(key) <= ttl
2367
2368 def test_increx_invalid_options(self, r):
2369 key = "increx:invalid"

Callers

nothing calls this directly

Calls 3

increxMethod · 0.80
setMethod · 0.45
ttlMethod · 0.45

Tested by

no test coverage detected