MCPcopy
hub / github.com/redis/redis-py / test_objkeys

Function test_objkeys

tests/test_json.py:399–412  ·  view source on GitHub ↗
(client)

Source from the content-addressed store, hash-verified

397
398@pytest.mark.redismod
399def 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

Callers

nothing calls this directly

Calls 6

root_pathMethod · 0.80
objkeysMethod · 0.80
sortMethod · 0.80
keysMethod · 0.80
setMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected