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

Method test_increx_byfloat

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

Source from the content-addressed store, hash-verified

2311
2312 @skip_if_server_version_lt("8.7.0")
2313 def test_increx_byfloat(self, r):
2314 key = "increx:float"
2315 assert r.set(key, "1.5")
2316 result = r.increx(key, byfloat=0.25, lbound=0, ubound=2)
2317 assert [float(value) for value in result] == pytest.approx([1.75, 0.25])
2318 assert float(r[key]) == pytest.approx(1.75)
2319
2320 @skip_if_server_version_lt("8.7.0")
2321 def test_increx_saturating_bounds(self, r):

Callers

nothing calls this directly

Calls 2

increxMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected