| 409 | |
| 410 | @pytest.mark.redismod |
| 411 | async def test_objkeys(decoded_r: redis.Redis): |
| 412 | obj = {"foo": "bar", "baz": "qaz"} |
| 413 | await decoded_r.json().set("obj", Path.root_path(), obj) |
| 414 | keys = await decoded_r.json().objkeys("obj", Path.root_path()) |
| 415 | keys.sort() |
| 416 | exp = list(obj.keys()) |
| 417 | exp.sort() |
| 418 | assert exp == keys |
| 419 | |
| 420 | await decoded_r.json().set("obj", Path.root_path(), obj) |
| 421 | keys = await decoded_r.json().objkeys("obj") |
| 422 | assert keys == list(obj.keys()) |
| 423 | |
| 424 | assert await decoded_r.json().objkeys("fakekey") is None |
| 425 | |
| 426 | |
| 427 | @pytest.mark.redismod |