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

Function test_json_commands_in_pipeline

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

Source from the content-addressed store, hash-verified

424
425@pytest.mark.redismod
426def test_json_commands_in_pipeline(client):
427 p = client.json().pipeline()
428 p.set("foo", Path.root_path(), "bar")
429 p.get("foo")
430 p.delete("foo")
431 assert p.execute() == [True, "bar", 1]
432 assert client.keys() == []
433 assert client.get("foo") is None
434
435 # now with a true, json object
436 client.flushdb()
437 p = client.json().pipeline()
438 d = {"hello": "world", "oh": "snap"}
439 with pytest.deprecated_call():
440 p.jsonset("foo", Path.root_path(), d)
441 p.jsonget("foo")
442 p.exists("notarealkey")
443 p.delete("foo")
444 assert p.execute() == [True, d, 0, 1]
445 assert client.keys() == []
446 assert client.get("foo") is None
447
448
449@pytest.mark.redismod

Callers

nothing calls this directly

Calls 12

root_pathMethod · 0.80
keysMethod · 0.80
flushdbMethod · 0.80
jsonsetMethod · 0.80
jsongetMethod · 0.80
pipelineMethod · 0.45
jsonMethod · 0.45
setMethod · 0.45
getMethod · 0.45
deleteMethod · 0.45
executeMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected