(client)
| 397 | |
| 398 | @pytest.mark.redismod |
| 399 | def test_objkeys(client): |
| 400 | obj = {"foo": "bar", "baz": "qaz"} |
| 401 | client.json().set("obj", Path.root_path(), obj) |
| 402 | keys = client.json().objkeys("obj", Path.root_path()) |
| 403 | keys.sort() |
| 404 | exp = list(obj.keys()) |
| 405 | exp.sort() |
| 406 | assert exp == keys |
| 407 | |
| 408 | client.json().set("obj", Path.root_path(), obj) |
| 409 | keys = client.json().objkeys("obj") |
| 410 | assert keys == list(obj.keys()) |
| 411 | |
| 412 | assert client.json().objkeys("fakekey") is None |
| 413 | |
| 414 | |
| 415 | @pytest.mark.redismod |