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.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_json.py b/tests/test_json.py
index a99547d..74b00ea 100644
--- a/tests/test_json.py
+++ b/tests/test_json.py
@@ -1392,3 +1392,15 @@ def test_custom_decoder(client):
assert client.exists("foo") == 0
assert not isinstance(cj.__encoder__, json.JSONEncoder)
assert not isinstance(cj.__decoder__, json.JSONDecoder)
+
+
+@pytest.mark.redismod
+def test_set_file(client):
+ import tempfile
+ import json
+
+ jsonfile = tempfile.NamedTemporaryFile(suffix=".json")
+ with open(jsonfile.name, 'w+') as fp:
+ fp.write(json.dumps({"hello": "world"}))
+
+ assert client.json().set("test", Path.rootPath(), jsonfile.name) \ No newline at end of file