summaryrefslogtreecommitdiff
path: root/tests/test_json.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_json.py')
-rw-r--r--tests/test_json.py32
1 files changed, 22 insertions, 10 deletions
diff --git a/tests/test_json.py b/tests/test_json.py
index 19b0c32..b3f38f7 100644
--- a/tests/test_json.py
+++ b/tests/test_json.py
@@ -275,16 +275,28 @@ def test_objlen(client):
assert len(obj) == client.json().objlen("obj")
-# @pytest.mark.pipeline
-# @pytest.mark.redismod
-# def test_pipelineshouldsucceed(client):
-# p = client.json().pipeline()
-# p.set("foo", Path.rootPath(), "bar")
-# p.get("foo")
-# p.delete("foo")
-# assert [True, "bar", 1] == p.execute()
-# assert client.keys() == []
-# assert client.get("foo") is None
+@pytest.mark.pipeline
+@pytest.mark.redismod
+def test_json_commands_in_pipeline(client):
+ p = client.json().pipeline()
+ p.set("foo", Path.rootPath(), "bar")
+ p.get("foo")
+ p.delete("foo")
+ assert [True, "bar", 1] == p.execute()
+ assert client.keys() == []
+ assert client.get("foo") is None
+
+ # now with a true, json object
+ client.flushdb()
+ p = client.json().pipeline()
+ d = {"hello": "world", "oh": "snap"}
+ p.jsonset("foo", Path.rootPath(), d)
+ p.jsonget("foo")
+ p.exists("notarealkey")
+ p.delete("foo")
+ assert [True, d, 0, 1] == p.execute()
+ assert client.keys() == []
+ assert client.get("foo") is None
@pytest.mark.redismod