| 462 | |
| 463 | @skip_if_server_version_lt("7.9.0") |
| 464 | async def test_hsetex_expiration_px(r): |
| 465 | await r.delete("test:hash") |
| 466 | # set items from key/value provided and mapping |
| 467 | # with expiration - testing px field |
| 468 | assert ( |
| 469 | await r.hsetex("test:hash", "foo", "bar", mapping={"1": 1, "2": "2"}, px=60000) |
| 470 | == 1 |
| 471 | ) |
| 472 | test_keys = ["foo", "1", "2"] |
| 473 | ttls = await r.httl("test:hash", *test_keys) |
| 474 | for ttl in ttls: |
| 475 | assert pytest.approx(ttl) == 60 |
| 476 | |
| 477 | assert await r.hgetex("test:hash", *test_keys) == [b"bar", b"1", b"2"] |
| 478 | |
| 479 | |
| 480 | @skip_if_server_version_lt("7.9.0") |