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

Method test_increx_saturating_bounds

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

Source from the content-addressed store, hash-verified

2319
2320 @skip_if_server_version_lt("8.7.0")
2321 def test_increx_saturating_bounds(self, r):
2322 key = "increx:sat"
2323 assert r.set(key, "1.8")
2324 result = r.increx(key, byfloat=0.7, ubound=2, saturate=True)
2325 assert [float(value) for value in result] == pytest.approx([2.0, 0.2])
2326 assert float(r[key]) == pytest.approx(2.0)
2327
2328 @skip_if_server_version_lt("8.7.0")
2329 def test_increx_overflow_rejected_keeps_value_and_ttl(self, r):

Callers

nothing calls this directly

Calls 2

increxMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected