| 346 | |
| 347 | @pytest.mark.redismod |
| 348 | def test_arrpop(client): |
| 349 | client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) |
| 350 | assert 4 == client.json().arrpop("arr", Path.root_path(), 4) |
| 351 | assert 3 == client.json().arrpop("arr", Path.root_path(), -1) |
| 352 | assert 2 == client.json().arrpop("arr", Path.root_path()) |
| 353 | assert 0 == client.json().arrpop("arr", Path.root_path(), 0) |
| 354 | assert [1] == client.json().get("arr") |
| 355 | |
| 356 | # test out of bounds |
| 357 | client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) |
| 358 | assert 4 == client.json().arrpop("arr", Path.root_path(), 99) |
| 359 | |
| 360 | # none test |
| 361 | client.json().set("arr", Path.root_path(), []) |
| 362 | assert client.json().arrpop("arr") is None |
| 363 | |
| 364 | |
| 365 | @pytest.mark.redismod |