summaryrefslogtreecommitdiff
path: root/tests/test_json.py
diff options
context:
space:
mode:
authorChayim I. Kirshen <c@kirshen.com>2021-11-03 14:19:16 +0200
committerChayim I. Kirshen <c@kirshen.com>2021-11-03 14:19:16 +0200
commit70466b2e206b215f37246c9f59286c74464a5e4b (patch)
tree79606774e7b21bd7941a8efc15be27e3dfed7592 /tests/test_json.py
parente18283aed05a47db20b9b091579ae1d5799226f4 (diff)
downloadredis-py-ck-json-multipath.tar.gz
tests against decoders directlyck-json-multipath
Diffstat (limited to 'tests/test_json.py')
-rw-r--r--tests/test_json.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_json.py b/tests/test_json.py
index e50582f..19b0c32 100644
--- a/tests/test_json.py
+++ b/tests/test_json.py
@@ -2,6 +2,7 @@ import pytest
import redis
from redis.commands.json.path import Path
from redis import exceptions
+from redis.commands.json.decoders import unstring, decode_list
from .conftest import skip_ifmodversion_lt
@@ -1374,3 +1375,13 @@ def test_arrindex_dollar(client):
"test_None",
"..nested2_not_found.arr",
"None") == 0
+
+
+def test_decoders_and_unstring():
+ assert unstring("4") == 4
+ assert unstring("45.55") == 45.55
+ assert unstring("hello world") == "hello world"
+
+ assert decode_list(b"45.55") == 45.55
+ assert decode_list("45.55") == 45.55
+ assert decode_list(['hello', b'world']) == ['hello', 'world']