| 510 | |
| 511 | @skip_if_server_version_lt("7.9.0") |
| 512 | def test_hsetex_expiration_px(r): |
| 513 | r.delete("test:hash") |
| 514 | # set items from key/value provided and mapping |
| 515 | # with expiration - testing px field |
| 516 | assert ( |
| 517 | r.hsetex("test:hash", "foo", "bar", mapping={"1": 1, "2": "2"}, px=60000) == 1 |
| 518 | ) |
| 519 | test_keys = ["foo", "1", "2"] |
| 520 | ttls = r.httl("test:hash", *test_keys) |
| 521 | for ttl in ttls: |
| 522 | assert pytest.approx(ttl) == 60 |
| 523 | assert r.hgetex("test:hash", *test_keys) == [b"bar", b"1", b"2"] |
| 524 | |
| 525 | |
| 526 | @skip_if_server_version_lt("7.9.0") |